diff --git a/PHPCI/Plugin/Atoum.php b/PHPCI/Plugin/Atoum.php new file mode 100644 index 00000000..a97fa00a --- /dev/null +++ b/PHPCI/Plugin/Atoum.php @@ -0,0 +1,51 @@ +phpci = $phpci; + + if (isset($options['executable'])) { + $this->executable = $options['executable']; + } + else { + $this->executable = './vendor/bin/atoum'; + } + + if (isset($options['args'])) { + $this->args = $options['args']; + } + + if (isset($options['config'])) { + $this->config = $options['config']; + } + + if (isset($options['directory'])) { + $this->directory = $options['directory']; + } + } + + public function execute() + { + $cmd = $this->phpci->buildPath . DIRECTORY_SEPARATOR . $this->executable; + + if ($this->args !== null) { + $cmd .= " {$this->args}"; + } + if ($this->config !== null) { + $cmd .= " -c '{$this->config}'"; + } + if ($this->directory !== null) { + $cmd .= " -d '{$this->directory}'"; + } + return $this->phpci->executeCommand($cmd); + } +}