Skip to content

Commit

Permalink
Initial step to replace simpletest for PHPUnit
Browse files Browse the repository at this point in the history
This is probably temporary, still needed to see if PHPUnit is already in path (installed with pear or something)
  • Loading branch information
lorenzo committed May 4, 2010
1 parent e0b4e3d commit 7417a00
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cake/tests/lib/cake_test_suite_dispatcher.php
Expand Up @@ -17,7 +17,6 @@
* @since CakePHP(tm) v 1.3
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
require_once CAKE_TESTS_LIB . 'test_manager.php';

/**
* CakeTestSuiteDispatcher handles web requests to the test suite and runs the correct action.
Expand Down Expand Up @@ -116,7 +115,18 @@ function dispatch() {
* @return void
*/
function _checkSimpleTest() {
if (!App::import('Vendor', 'simpletest/reporter')) {
$found = $path = null;
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'))) {
$found = include 'PHPUnit' . DS . 'Framework.php';
}

if (!$found) {
$baseDir = $this->_baseDir;
include CAKE_TESTS_LIB . 'templates/simpletest.php';
exit();
Expand Down Expand Up @@ -171,6 +181,7 @@ function _groupTestList() {
*/
function &getManager() {
if (empty($this->Manager)) {
require_once CAKE_TESTS_LIB . 'test_manager.php';
$this->Manager = new $this->_managerClass();
}
return $this->Manager;
Expand Down

0 comments on commit 7417a00

Please sign in to comment.