Skip to content

Commit

Permalink
Code cleanup, break if found, no reason to go through entire vendor l…
Browse files Browse the repository at this point in the history
…ist overwriting if found on first try. No reason to create variables we don't need.
  • Loading branch information
webtechnick committed Jun 11, 2012
1 parent 4280951 commit ae990cc
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
Expand Up @@ -136,20 +136,14 @@ protected function _checkPHPUnit() {
* @return boolean true if found, false otherwise
*/
public function loadTestFramework() {
$found = $path = null;

foreach (App::path('vendors') as $vendor) {
if (is_dir($vendor . 'PHPUnit')) {
$path = $vendor;
ini_set('include_path', $vendor . PATH_SEPARATOR . ini_get('include_path'));
break;
}
}

if($path){
ini_set('include_path', $path . PATH_SEPARATOR . ini_get('include_path'));
}

$found = include 'PHPUnit' . DS . 'Autoload.php';
return $found;
return include 'PHPUnit' . DS . 'Autoload.php';
}

/**
Expand Down

0 comments on commit ae990cc

Please sign in to comment.