Adding basic Behat plugin, fixes #101
This commit is contained in:
parent
ede49c8c69
commit
47672c014f
1 changed files with 47 additions and 0 deletions
47
PHPCI/Plugin/Behat.php
Normal file
47
PHPCI/Plugin/Behat.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2013, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link http://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCI\Plugin;
|
||||
|
||||
/**
|
||||
* Behat BDD Plugin
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue