From 21afcef7cf07bb2b21047266d7eb46427faf1a47 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 5 Jan 2010 23:12:28 -0500 Subject: [PATCH] Updating CakeTestSuiteDispatcher to get base url and base dir. Refactoring xdebug and simpletest error pages. Starting to phase out CakeTestMenu. --- cake/tests/lib/cake_test_suite_dispatcher.php | 28 +++++++++++++++++-- cake/tests/lib/templates/header.php | 2 +- cake/tests/lib/templates/simpletest.php | 6 ++-- cake/tests/lib/templates/xdebug.php | 13 +++++---- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 5de18820a..9e5b2982f 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -56,6 +56,30 @@ class CakeTestSuiteDispatcher { */ var $Manager; +/** + * Baseurl for the request + * + * @var string + */ + var $_baseUrl; + +/** + * Base dir of the request. Used for accessing assets. + * + * @var string + */ + var $_baseDir; + +/** + * constructor + * + * @return void + */ + function CakeTestSuiteDispatcher() { + $this->_baseUrl = $_SERVER['PHP_SELF']; + $this->_baseDir = dirname($this->_baseUrl) . '/'; + } + /** * Runs the actions required by the URL parameters. * @@ -90,8 +114,8 @@ class CakeTestSuiteDispatcher { */ function _checkSimpleTest() { if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { + $baseUrl = $this->_baseDir; include CAKE_TESTS_LIB . 'templates' . DS . 'simpletest.php'; - CakeTestMenu::footer(); exit(); } } @@ -104,8 +128,8 @@ class CakeTestSuiteDispatcher { */ function _checkXdebug() { if (!extension_loaded('xdebug')) { + $baseUrl = $this->_baseDir; include CAKE_TESTS_LIB . 'templates' . DS . 'xdebug.php'; - CakeTestMenu::footer(); exit(); } } diff --git a/cake/tests/lib/templates/header.php b/cake/tests/lib/templates/header.php index ab521a69f..faf49f653 100644 --- a/cake/tests/lib/templates/header.php +++ b/cake/tests/lib/templates/header.php @@ -21,7 +21,7 @@ - + CakePHP Test Suite 1.3