From ff8bd75b22eccc37c53ba87ceedfa168b0f03390 Mon Sep 17 00:00:00 2001 From: Sanpi Date: Wed, 19 Jun 2013 11:29:52 +0200 Subject: [PATCH] Add atoum plugin --- PHPCI/Plugin/Atoum.php | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 PHPCI/Plugin/Atoum.php 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); + } +}