Skip to content

Commit

Permalink
Merge pull request #458 from corpsee/phpunit-improvements
Browse files Browse the repository at this point in the history
Removed useless args
  • Loading branch information
dancryer committed Jun 13, 2014
2 parents e578523 + 3834d01 commit c9f56cb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions PHPCI/Plugin/PhpUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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;
}
Expand Down

1 comment on commit c9f56cb

@jimmycleuren
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.