Skip to content

Commit

Permalink
No longer suppress the include path to PHPUnit/Autoload.php as Autolo…
Browse files Browse the repository at this point in the history
…ad.php require_once() on two files, if either of them aren't there the shell exits without message. Explanation of issue here: http://www.webtechnick.com/wtn/blogs/view/247/Fixing_PHPUnit_for_CakePHP_2_x_testing_on_Mac_OS_X
  • Loading branch information
webtechnick committed Jun 11, 2012
1 parent c318586 commit 4280951
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -138,21 +138,17 @@ protected function _checkPHPUnit() {
public function loadTestFramework() { public function loadTestFramework() {
$found = $path = null; $found = $path = null;


if (@include 'PHPUnit' . DS . 'Autoload.php') { foreach (App::path('vendors') as $vendor) {
$found = true; if (is_dir($vendor . 'PHPUnit')) {
} $path = $vendor;

if (!$found) {
foreach (App::path('vendors') as $vendor) {
if (is_dir($vendor . 'PHPUnit')) {
$path = $vendor;
}
} }
}


if ($path && ini_set('include_path', $path . PATH_SEPARATOR . ini_get('include_path'))) { if($path){
$found = include 'PHPUnit' . DS . 'Autoload.php'; ini_set('include_path', $path . PATH_SEPARATOR . ini_get('include_path'));
}
} }

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


Expand Down

0 comments on commit 4280951

Please sign in to comment.