From de2fbc96725398b525d88c9606f26e51ce517416 Mon Sep 17 00:00:00 2001 From: Steve Kamerman Date: Sun, 19 May 2013 18:52:56 -0400 Subject: [PATCH] Changed default behavior to run a single PHPUnit config from the directory where the config file is read from, this can be changed via 'run_from: dir/' --- PHPCI/Plugin/PhpUnit.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PHPCI/Plugin/PhpUnit.php b/PHPCI/Plugin/PhpUnit.php index b579806f..e7956ed9 100644 --- a/PHPCI/Plugin/PhpUnit.php +++ b/PHPCI/Plugin/PhpUnit.php @@ -92,17 +92,19 @@ class PhpUnit implements \PHPCI\Plugin if (is_array($configPath)) { return $this->recurseArg($configPath, array($this, "runConfigFile")); } else { + + $curdir = getcwd(); + if ($this->runFrom) { - $curdir = getcwd(); chdir($this->phpci->buildPath.'/'.$this->runFrom); + } else { + chdir($this->phpci->buildPath.'/'.dirname($configPath)); } $cmd = $this->phpunit_cmd . ' %s -c "%s"'; $success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $configPath); - if ($this->runFrom) { - chdir($curdir); - } + chdir($curdir); return $success; }