Skip to content
Permalink
Browse files

Merge pull request #458 from corpsee/phpunit-improvements

Removed useless args
  • Loading branch information...
dancryer committed Jun 13, 2014
2 parents e578523 + 3834d01 commit c9f56cb4608c3b5b7d8dcd3180bca52fd96f3102
Showing with 10 additions and 10 deletions.
  1. +10 −10 PHPCI/Plugin/PhpUnit.php
@@ -124,12 +124,12 @@ public function execute()
// Run any config files first. This can be either a single value or an array.
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.
if ($this->directory !== null) {
$success &= $this->runDir($this->directory);
$success &= $this->runDir();
}
$tapString = $this->phpci->getLastOutput();
@@ -152,10 +152,10 @@ public function execute()
return $success;
}
protected function runConfigFile($configPath)
protected function runConfigFile()
{
if (is_array($configPath)) {
return $this->recurseArg($configPath, array($this, "runConfigFile"));
if (is_array($this->xmlConfigFile)) {
return $this->recurseArg($this->xmlConfigFile, array($this, "runConfigFile"));
} else {
if ($this->runFrom) {
$curdir = getcwd();
@@ -172,7 +172,7 @@ protected function runConfigFile($configPath)
$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) {
chdir($curdir);
@@ -182,10 +182,10 @@ protected function runConfigFile($configPath)
}
}
protected function runDir($dirPath)
protected function runDir()
{
if (is_array($dirPath)) {
return $this->recurseArg($dirPath, array($this, "runDir"));
if (is_array($this->directory)) {
return $this->recurseArg($this->directory, array($this, "runDir"));
} else {
$curdir = getcwd();
chdir($this->phpci->buildPath);
@@ -198,7 +198,7 @@ protected function runDir($dirPath)
}
$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);
return $success;
}

1 comment on commit c9f56cb

@jimmycleuren

This comment has been minimized.

Copy link
Contributor

commented on c9f56cb Jun 16, 2014

Since this merge, the phpunit plugin is broken. recurseArgs is always called wit the same argument causing an infinite call loop (unless you have xdebug installed). I think it's best to revert this one.

Please sign in to comment.
You can’t perform that action at this time.