Updating the skel and app test.php's to not make a global variable for the dispatcher. This dramatically improves the performance of the web test runner.

This commit is contained in:
mark_story 2010-08-16 23:33:07 -04:00
parent f46241a6e7
commit 4622ec44c2
3 changed files with 17 additions and 9 deletions

View file

@ -90,5 +90,4 @@ if (Configure::read('debug') < 1) {
require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php'; require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
$Dispatcher = new CakeTestSuiteDispatcher(); CakeTestSuiteDispatcher::run();
$Dispatcher->dispatch();

View file

@ -5,15 +5,15 @@
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing> * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* *
* Licensed under The Open Group Test Suite License * Licensed under The Open Group Test Suite License
* Redistributions of files must retain the above copyright notice. * Redistributions of files must retain the above copyright notice.
* *
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests * @link http://book.cakephp.org/view/1196/Testing
* @package cake * @package cake
* @subpackage cake.cake.tests.libs * @subpackage cake.app.webroot
* @since CakePHP(tm) v 1.2.0.4433 * @since CakePHP(tm) v 1.2.0.4433
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
@ -85,10 +85,9 @@ if (isset($corePath[0])) {
} }
if (Configure::read('debug') < 1) { if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.')); die(__('Debug setting does not allow access to this url.', true));
} }
require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php'; require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
$Dispatcher = new CakeTestSuiteDispatcher(); CakeTestSuiteDispatcher::run();
$Dispatcher->dispatch();

View file

@ -113,6 +113,16 @@ class CakeTestSuiteDispatcher {
return $value; return $value;
} }
/**
* Static method to initialize the test runner, keeps global space clean
*
* @return void
*/
public static function run() {
$dispatcher = new CakeTestSuiteDispatcher();
$dispatcher->dispatch();
}
/** /**
* Checks that PHPUnit is installed. Will exit if it doesn't * Checks that PHPUnit is installed. Will exit if it doesn't
* *