Remove infinite recursion when using an array of directories in PHP Unit config.
Fixes #596
This commit is contained in:
parent
8b7b1afe71
commit
a92c72e801
|
@ -129,7 +129,7 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
|||
|
||||
// Run any dirs next. Again this can be either a single value or an array.
|
||||
if ($this->directory !== null) {
|
||||
$success &= $this->runDir();
|
||||
$success &= $this->runDir($this->directory);
|
||||
}
|
||||
|
||||
$tapString = $this->phpci->getLastOutput();
|
||||
|
@ -182,10 +182,10 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
|||
}
|
||||
}
|
||||
|
||||
protected function runDir()
|
||||
protected function runDir($directory)
|
||||
{
|
||||
if (is_array($this->directory)) {
|
||||
return $this->recurseArg($this->directory, array($this, "runDir"));
|
||||
if (is_array($directory)) {
|
||||
return $this->recurseArg($directory, array($this, "runDir"));
|
||||
} else {
|
||||
$curdir = getcwd();
|
||||
chdir($this->phpci->buildPath);
|
||||
|
@ -198,7 +198,7 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
|||
}
|
||||
|
||||
$cmd = $phpunit . ' --tap %s "%s"';
|
||||
$success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $this->directory);
|
||||
$success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $directory);
|
||||
chdir($curdir);
|
||||
return $success;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue