Updating html for test suite.

Added error page when SimpleTest is not installed.
Fixed model.test.php failing on PHP 4

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4440 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-02-04 04:38:42 +00:00
parent 50c24a738e
commit 0997bea85c
5 changed files with 55 additions and 10 deletions

View file

@ -66,9 +66,6 @@ require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_manager.php';
if(DEBUG < 1) { if(DEBUG < 1) {
die('Invalid url.'); die('Invalid url.');
} }
if(!vendor('simpletest' . DS . 'reporter')) {
die('SimpleTest is not installed.');
}
if (!isset($_SERVER['SERVER_NAME'])) { if (!isset($_SERVER['SERVER_NAME'])) {
$_SERVER['SERVER_NAME'] = ''; $_SERVER['SERVER_NAME'] = '';
@ -94,6 +91,13 @@ if(isset($_GET['output']) && $_GET['output'] == 'html') {
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT); define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT);
} }
if(!vendor('simpletest' . DS . 'reporter')) {
CakePHPTestHeader();
include CAKE . 'tests' . DS . 'lib' . DS . 'simpletest.php';
CakePHPTestSuiteFooter();
exit();
}
function &CakeTestsGetReporter() { function &CakeTestsGetReporter() {
static $Reporter = NULL; static $Reporter = NULL;
if (!$Reporter) { if (!$Reporter) {
@ -162,6 +166,7 @@ if(isset($_GET['output']) && $_GET['output'] == 'html') {
switch (CAKE_TEST_OUTPUT) { switch (CAKE_TEST_OUTPUT) {
case CAKE_TEST_OUTPUT_HTML: case CAKE_TEST_OUTPUT_HTML:
$baseUrl = BASE_URL; $baseUrl = BASE_URL;
$characterSet = 'ISO-8859-1';
include CAKE . 'tests' . DS . 'lib' . DS . 'header.php'; include CAKE . 'tests' . DS . 'lib' . DS . 'header.php';
break; break;
case CAKE_TEST_OUTPUT_TEXT: case CAKE_TEST_OUTPUT_TEXT:
@ -189,10 +194,10 @@ if(isset($_GET['output']) && $_GET['output'] == 'html') {
break; break;
} }
} }
CakePHPTestHeader(); CakePHPTestHeader();
CakePHPTestSuiteHeader(); CakePHPTestSuiteHeader();
if (isset($_GET['group'])) { if (isset($_GET['group'])) {
if ('all' == $_GET['group']) { if ('all' == $_GET['group']) {
TestManager::runAllTests(CakeTestsGetReporter()); TestManager::runAllTests(CakeTestsGetReporter());

View file

@ -31,7 +31,10 @@
} }
require_once LIBS.'model'.DS.'model.php'; require_once LIBS.'model'.DS.'model.php';
class Test extends Model { var $useTable = false; } class Test extends Model {
var $useTable = false;
var $name = 'Test';
}
/** /**
* Short description for class. * Short description for class.
* *

View file

@ -28,7 +28,6 @@
*/ */
?> ?>
<div id="content"> <div id="content">
<h1>CakePHP Test Suite v 1.2.0.0</h1>
<ul> <ul>
<li><a href='<?php echo $groups;?>'>Core Test Groups</a></li> <li><a href='<?php echo $groups;?>'>Core Test Groups</a></li>
<li><a href='<?php echo $cases;?>'>Core Test Cases</a></li> <li><a href='<?php echo $cases;?>'>Core Test Cases</a></li>
@ -37,5 +36,4 @@
<li><a href='<?php echo $groups;?>&amp;app=true'>App Test Groups</a></li> <li><a href='<?php echo $groups;?>&amp;app=true'>App Test Groups</a></li>
<li><a href='<?php echo $cases;?>&amp;app=true'>App Test Cases</a></li> <li><a href='<?php echo $cases;?>&amp;app=true'>App Test Cases</a></li>
</ul> </ul>

View file

@ -30,7 +30,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; charset=iso-8859-1' /> <meta http-equiv='content-Type' content='text/html; <?php echo $characterSet; ?>' />
<title>CakePHP Test Suite v 1.2.0.0</title> <title>CakePHP Test Suite v 1.2.0.0</title>
<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl; ?>/css/cake.generic.css" /> <link rel="stylesheet" type="text/css" href="<?php echo $baseUrl; ?>/css/cake.generic.css" />
<style> <style>
@ -43,4 +43,5 @@
<div id="container"> <div id="container">
<div id="header"> <div id="header">
<h1>CakePHP: the PHP Rapid Development Framework</h1> <h1>CakePHP: the PHP Rapid Development Framework</h1>
<h2>CakePHP Test Suite v 1.2.0.0</h2>
</div> </div>

View file

@ -0,0 +1,38 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
* Copyright 2005-2007, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The Open Group Test Suite License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake
* @subpackage cake.cake.tests.libs
* @since CakePHP(tm) v 1.2.0.4433
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
?>
<div id="content">
<h2>SimpleTest is not installed</h2>
<p>You must install SimpleTest to use the CakePHP(tm) Test Suite.</p>
<p>SimpleTest can be placed in one of the follwing directories.</p>
<ul>
<li><?php echo CAKE; ?>vendors </li>
<li><?php echo APP_DIR . DS; ?>vendors</li>
</ul>
<p><a href="http://www.simpletest.org/en/download.html" target="_new">Download SimpleTest</a></p>