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