From 8bd6e1683c3da7ad0255244ed105e534a06e7b1f Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Mon, 1 Dec 2014 15:32:50 +0000 Subject: [PATCH] Remove infinite recursion when using an array of directories in PHP Unit config. Fixes #596 --- PHPCI/Plugin/PhpUnit.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PHPCI/Plugin/PhpUnit.php b/PHPCI/Plugin/PhpUnit.php index 3bb1c1c7..c643416b 100644 --- a/PHPCI/Plugin/PhpUnit.php +++ b/PHPCI/Plugin/PhpUnit.php @@ -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; }