Merge pull request #458 from corpsee/phpunit-improvements

Removed useless args
This commit is contained in:
Dan Cryer 2014-06-13 13:49:32 +01:00
commit c9f56cb460

View file

@ -124,12 +124,12 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
// Run any config files first. This can be either a single value or an array. // Run any config files first. This can be either a single value or an array.
if ($this->xmlConfigFile !== null) { if ($this->xmlConfigFile !== null) {
$success &= $this->runConfigFile($this->xmlConfigFile); $success &= $this->runConfigFile();
} }
// Run any dirs next. Again this can be either a single value or an array. // Run any dirs next. Again this can be either a single value or an array.
if ($this->directory !== null) { if ($this->directory !== null) {
$success &= $this->runDir($this->directory); $success &= $this->runDir();
} }
$tapString = $this->phpci->getLastOutput(); $tapString = $this->phpci->getLastOutput();
@ -152,10 +152,10 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
return $success; return $success;
} }
protected function runConfigFile($configPath) protected function runConfigFile()
{ {
if (is_array($configPath)) { if (is_array($this->xmlConfigFile)) {
return $this->recurseArg($configPath, array($this, "runConfigFile")); return $this->recurseArg($this->xmlConfigFile, array($this, "runConfigFile"));
} else { } else {
if ($this->runFrom) { if ($this->runFrom) {
$curdir = getcwd(); $curdir = getcwd();
@ -172,7 +172,7 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
$cmd = $phpunit . ' --tap %s -c "%s" ' . $this->coverage . $this->path; $cmd = $phpunit . ' --tap %s -c "%s" ' . $this->coverage . $this->path;
$success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $configPath); $success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $this->xmlConfigFile);
if ($this->runFrom) { if ($this->runFrom) {
chdir($curdir); chdir($curdir);
@ -182,10 +182,10 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
} }
} }
protected function runDir($dirPath) protected function runDir()
{ {
if (is_array($dirPath)) { if (is_array($this->directory)) {
return $this->recurseArg($dirPath, array($this, "runDir")); return $this->recurseArg($this->directory, array($this, "runDir"));
} else { } else {
$curdir = getcwd(); $curdir = getcwd();
chdir($this->phpci->buildPath); chdir($this->phpci->buildPath);
@ -198,7 +198,7 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
} }
$cmd = $phpunit . ' --tap %s "%s"'; $cmd = $phpunit . ' --tap %s "%s"';
$success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $dirPath); $success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $this->directory);
chdir($curdir); chdir($curdir);
return $success; return $success;
} }