diff --git a/PHPCI/Plugin/Behat.php b/PHPCI/Plugin/Behat.php new file mode 100644 index 00000000..c9c832ce --- /dev/null +++ b/PHPCI/Plugin/Behat.php @@ -0,0 +1,47 @@ + + * @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; + } +}