diff --git a/PHPCI/Plugin/Atoum.php b/PHPCI/Plugin/Atoum.php index a97fa00a..1e2aeca3 100644 --- a/PHPCI/Plugin/Atoum.php +++ b/PHPCI/Plugin/Atoum.php @@ -7,7 +7,6 @@ class Atoum implements \PHPCI\Plugin private $args; private $config; private $directory; - private $executable; public function __construct(\PHPCI\Builder $phpci, array $options = array()) { @@ -17,7 +16,7 @@ class Atoum implements \PHPCI\Plugin $this->executable = $options['executable']; } else { - $this->executable = './vendor/bin/atoum'; + $this->executable = PHPCI_BIN_DIR.'atoum'; } if (isset($options['args'])) { @@ -35,7 +34,7 @@ class Atoum implements \PHPCI\Plugin public function execute() { - $cmd = $this->phpci->buildPath . DIRECTORY_SEPARATOR . $this->executable; + $cmd = $this->executable; if ($this->args !== null) { $cmd .= " {$this->args}"; @@ -44,8 +43,19 @@ class Atoum implements \PHPCI\Plugin $cmd .= " -c '{$this->config}'"; } if ($this->directory !== null) { - $cmd .= " -d '{$this->directory}'"; + $dirPath = $this->phpci->buildPath . DIRECTORY_SEPARATOR . $this->directory; + $cmd .= " -d '{$dirPath}'"; } - return $this->phpci->executeCommand($cmd); + + $output = ''; + $status = true; + exec($cmd, $output); + + if (!empty($output) && count(preg_grep("/error/i",$output)) > 0) { + $status = false; + $this->phpci->log($output, ' '); + } + + return $status; } } diff --git a/composer.json b/composer.json index a4424830..ae912b8d 100755 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "symfony/yaml" : "2.2.x-dev", "symfony/console" : "2.2.*", "fabpot/php-cs-fixer" : "0.3.*@dev", - "swiftmailer/swiftmailer" : "v5.0.0" + "swiftmailer/swiftmailer" : "v5.0.0", + "atoum/atoum":"*" } }