* @package PHPCI * @subpackage Plugins */ class Behat implements \PHPCI\Plugin { protected $phpci; public function __construct(\PHPCI\Builder $phpci, array $options = array()) { $this->phpci = $phpci; } /** * Runs Behat tests. */ public function execute() { $curdir = getcwd(); chdir($this->phpci->buildPath); $phpspec = $this->phpci->findBinary('phpspec'); if (!$phpspec) { $this->phpci->logFailure('Could not find phpspec.'); return false; } $success = $this->phpci->executeCommand($phpspec); chdir($curdir); return $success; } }