Updating CakeTestSuiteDispatcher to get base url and base dir. Refactoring xdebug and simpletest error pages. Starting to phase out CakeTestMenu.

This commit is contained in:
Mark Story 2010-01-05 23:12:28 -05:00
parent 44cacf6dad
commit 21afcef7cf
4 changed files with 39 additions and 10 deletions

View file

@ -56,6 +56,30 @@ class CakeTestSuiteDispatcher {
*/ */
var $Manager; 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. * Runs the actions required by the URL parameters.
* *
@ -90,8 +114,8 @@ class CakeTestSuiteDispatcher {
*/ */
function _checkSimpleTest() { function _checkSimpleTest() {
if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) {
$baseUrl = $this->_baseDir;
include CAKE_TESTS_LIB . 'templates' . DS . 'simpletest.php'; include CAKE_TESTS_LIB . 'templates' . DS . 'simpletest.php';
CakeTestMenu::footer();
exit(); exit();
} }
} }
@ -104,8 +128,8 @@ class CakeTestSuiteDispatcher {
*/ */
function _checkXdebug() { function _checkXdebug() {
if (!extension_loaded('xdebug')) { if (!extension_loaded('xdebug')) {
$baseUrl = $this->_baseDir;
include CAKE_TESTS_LIB . 'templates' . DS . 'xdebug.php'; include CAKE_TESTS_LIB . 'templates' . DS . 'xdebug.php';
CakeTestMenu::footer();
exit(); exit();
} }
} }

View file

@ -21,7 +21,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv='content-Type' content='text/html; <?php echo $characterSet; ?>' /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CakePHP Test Suite 1.3</title> <title>CakePHP Test Suite 1.3</title>
<style type="text/css"> <style type="text/css">
h3 {font-size: 170%; padding-top: 1em} h3 {font-size: 170%; padding-top: 1em}

View file

@ -1,6 +1,6 @@
<?php <?php
/** /**
* Short description for file. * Missing SimpleTest error page.
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -18,6 +18,7 @@
* @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
*/ */
?> ?>
<?php include dirname(__FILE__) . DS . 'header.php'; ?>
<div id="content"> <div id="content">
<h2>SimpleTest is not installed</h2> <h2>SimpleTest is not installed</h2>
<p>You must install SimpleTest to use the CakePHP(tm) Test Suite.</p> <p>You must install SimpleTest to use the CakePHP(tm) Test Suite.</p>
@ -27,4 +28,5 @@
<li><?php echo APP_DIR . DS; ?>vendors</li> <li><?php echo APP_DIR . DS; ?>vendors</li>
</ul> </ul>
<p><a href="http://simpletest.org/en/download.html" target="_blank">Download SimpleTest</a></p> <p><a href="http://simpletest.org/en/download.html" target="_blank">Download SimpleTest</a></p>
</div> </div>
<?php include dirname(__FILE__) . DS . 'footer.php'; ?>

View file

@ -1,6 +1,6 @@
<?php <?php
/** /**
* Short description for file. * Xdebug error page
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -18,7 +18,10 @@
* @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
*/ */
?> ?>
<div id="content"> <?php include dirname(__FILE__) . DS . 'header.php'; ?>
<h2>Xdebug is not installed</h2> <div id="content">
<p>You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation.</p> <h2>Xdebug is not installed</h2>
<p><a href="http://www.xdebug.org/docs/install" target="_blank">Learn How To Install Xdebug</a></p> <p>You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation.</p>
<p><a href="http://www.xdebug.org/docs/install" target="_blank">Learn How To Install Xdebug</a></p>
</div>
<?php include dirname(__FILE__) . DS . 'footer.php'; ?>