Skip to content

Commit

Permalink
Renaming menu template file.
Browse files Browse the repository at this point in the history
Refactoring logic from CakeTestMenu into the Reporters.
  • Loading branch information
markstory committed Jan 7, 2010
1 parent 4c0d90c commit a0f5d0f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 81 deletions.
18 changes: 0 additions & 18 deletions cake/tests/lib/cake_test_menu.php
Expand Up @@ -84,24 +84,6 @@ function testHeader() {
}
}

/**
* Provides the left hand navigation for the testsuite
*
* @return void
* @access public
*/
function testSuiteHeader() {
switch (CAKE_TEST_OUTPUT) {
case CAKE_TEST_OUTPUT_HTML:
ob_start();
$groups = $_SERVER['PHP_SELF'] . '?show=groups';
$cases = $_SERVER['PHP_SELF'] . '?show=cases';
$plugins = App::objects('plugin');
include CAKE_TESTS_LIB . 'content.php';
break;
}
}

/**
* Provides the testsuite footer text
*
Expand Down
4 changes: 2 additions & 2 deletions cake/tests/lib/cake_test_suite_dispatcher.php
Expand Up @@ -139,7 +139,7 @@ function _testCaseList() {
$Reporter =& $this->getReporter();
$Reporter->paintDocumentHeader();
$Reporter->paintTestMenu();
CakeTestMenu::testCaseList();
$Reporter->testCaseList();
$Reporter->paintDocumentEnd();
}

Expand All @@ -152,7 +152,7 @@ function _groupTestList() {
$Reporter =& $this->getReporter();
$Reporter->paintDocumentHeader();
$Reporter->paintTestMenu();
CakeTestMenu::groupTestList();
$Reporter->groupTestList();
$Reporter->paintDocumentEnd();
}

Expand Down
23 changes: 22 additions & 1 deletion cake/tests/lib/reporter/cake_html_reporter.php
Expand Up @@ -129,7 +129,28 @@ function paintDocumentHeader() {
* @return void
*/
function paintTestMenu() {
CakeTestMenu::testSuiteHeader();
$groups = $_SERVER['PHP_SELF'] . '?show=groups';
$cases = $_SERVER['PHP_SELF'] . '?show=cases';
$plugins = App::objects('plugin');
include CAKE_TESTS_LIB . 'templates' . DS . 'menu.php';
}

/**
* Retrieves and paints the list of tests cases in an HTML format.
*
* @return void
*/
function testCaseList() {
CakeTestMenu::testCaseList();
}

/**
* Retrieves and paints the list of group tests in an HTML format.
*
* @return void
*/
function groupTestList() {
CakeTestMenu::groupTestList();
}

/**
Expand Down
58 changes: 0 additions & 58 deletions cake/tests/lib/templates/content.php

This file was deleted.

Expand Up @@ -21,7 +21,7 @@
<div class="test-menu">
<ul>
<li>
<span style="font-size: 18px">App</span>
<span style="font-size: 18px">App</span>
<ul>
<li><a href='<?php echo $groups;?>&amp;app=true'>Test Groups</a></li>
<li><a href='<?php echo $cases;?>&amp;app=true'>Test Cases</a></li>
Expand All @@ -31,7 +31,7 @@
if (!empty($plugins)):
?>
<li style="padding-top: 10px">
<span style="font-size: 18px">Plugins</span>
<span style="font-size: 18px">Plugins</span>
<?php foreach($plugins as $plugin):
$pluginPath = Inflector::underscore($plugin);
?>
Expand Down

0 comments on commit a0f5d0f

Please sign in to comment.