\n";
+ break;
+ }
+ }
+
+ function CakePHPTestCaseList() {
+ switch (CAKE_TEST_OUTPUT) {
+ case CAKE_TEST_OUTPUT_HTML:
+ if (isset($_GET['app'])) {
+ echo HtmlTestManager::getTestCaseList(APP_TEST_CASES);
+ } else {
+ echo HtmlTestManager::getTestCaseList(CORE_TEST_CASES);
+ }
+ break;
+ case CAKE_TEST_OUTPUT_TEXT:
+ default:
+ if (isset($_GET['app'])) {
+ echo TextTestManager::getTestCaseList(APP_TEST_CASES);
+ } else {
+ echo TextTestManager::getTestCaseList(CORE_TEST_CASES);
+ }
+ break;
+ }
+ }
+
+ function CakePHPTestGroupTestList() {
+ switch (CAKE_TEST_OUTPUT) {
+ case CAKE_TEST_OUTPUT_HTML:
+ if (isset($_GET['app'])) {
+ echo HtmlTestManager::getGroupTestList(APP_TEST_GROUPS);
+ } else {
+ echo HtmlTestManager::getGroupTestList(CORE_TEST_GROUPS);
+ }
+ break;
+ case CAKE_TEST_OUTPUT_TEXT:
+ default:
+ if (isset($_GET['app'])) {
+ echo TextTestManager::getGroupTestList(APP_TEST_GROUPS);
+ } else {
+ echo TextTestManager::getGroupTestList(CORE_TEST_GROUPS);
+ }
+ break;
+ }
+ }
+
+ function CakePHPTestHeader() {
+ switch (CAKE_TEST_OUTPUT) {
+ case CAKE_TEST_OUTPUT_HTML:
+ $baseUrl = BASE_URL;
+ include 'cake' . DS . 'tests' . DS . 'lib' . DS . 'header.php';
+ break;
+ case CAKE_TEST_OUTPUT_TEXT:
+ default:
+ header(' content-type: text/plain');
+ break;
+ }
+ }
+
+ function CakePHPTestSuiteHeader() {
+ switch (CAKE_TEST_OUTPUT) {
+ case CAKE_TEST_OUTPUT_HTML:
+ $groups = $_SERVER['PHP_SELF'].'?show=groups';
+ $cases = $_SERVER['PHP_SELF'].'?show=cases';
+ include 'cake' . DS . 'tests' . DS . 'lib' . DS . 'content.php';
+ break;
+ }
+ }
+
+ function CakePHPTestSuiteFooter() {
+ switch ( CAKE_TEST_OUTPUT) {
+ case CAKE_TEST_OUTPUT_HTML:
+ include 'cake' . DS . 'tests' . DS . 'lib' . DS . 'footer.php';
+ break;
+ }
+ }
+
+ if (isset($_GET['group'])) {
+ if ('all' == $_GET['group']) {
+ TestManager::runAllTests(CakeTestsGetReporter());
+ } else {
+ if (isset($_GET['app'])) {
+ TestManager::runGroupTest(ucfirst($_GET['group']), APP_TEST_GROUPS, CakeTestsGetReporter());
+ } else {
+ TestManager::runGroupTest(ucfirst($_GET['group']), CORE_TEST_GROUPS, CakeTestsGetReporter());
+ }
+ }
+ CakePHPTestRunMore();
+ CakePHPTestSuiteFooter();
+ exit();
+ }
+
+ if (isset($_GET['case'])) {
+ TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
+ CakePHPTestRunMore();
+ CakePHPTestSuiteFooter();
+ exit();
+ }
+
+ CakePHPTestHeader();
+ CakePHPTestSuiteHeader();
+
+ if (isset($_GET['show']) && $_GET['show'] == 'cases') {
+ CakePHPTestCaseList();
+ } else {
+ CakePHPTestGroupTestList();
+ }
+ CakePHPTestSuiteFooter();
+?>
\ No newline at end of file
diff --git a/cake/tests/lib/cake_reporter.php b/cake/tests/lib/cake_reporter.php
new file mode 100644
index 000000000..acd132241
--- /dev/null
+++ b/cake/tests/lib/cake_reporter.php
@@ -0,0 +1,90 @@
+
+ * 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
+ */
+/**
+ * Short description for class.
+ *
+ * @package cake
+ * @subpackage cake.cake.tests.lib
+ */
+class CakeHtmlReporter extends HtmlReporter {
+/**
+ * Does nothing yet. The first output will
+ * be sent on the first test start. For use
+ * by a web browser.
+ * @access public
+ */
+ function CakeHtmlReporter($characterSet = 'ISO-8859-1') {
+ parent::HtmlReporter($characterSet);
+ }
+/**
+ * Paints the top of the web page setting the
+ * title to the name of the starting test.
+ * @param string $test_name Name class of test.
+ * @access public
+ */
+ function paintHeader($testName) {
+ $this->sendNoCacheHeaders();
+ $baseUrl = BASE_URL;
+ print "\n";
+ print "\n";
+ print "\n";
+ print "\n";
+ print "CakePHP(tm) Test Suite v 1.2.0.0 :: $testName\n";
+ print "\n";
+ print "\n";
+ print "\n\n";
+ print "
\n";
+ print "
\n";
+ print "
CakePHP(tm) Test Suite v 1.2.0.0
\n";
+ print "
$testName
\n";
+ flush();
+ }
+/**
+ * Paints the end of the test with a summary of
+ * the passes and failures.
+ * @param string $test_name Name class of test.
+ * @access public
+ *
+ */
+ function paintFooter($testName) {
+ $colour = ($this->getFailCount() + $this->getExceptionCount() > 0 ? "red" : "green");
+ print "