Permalink
Browse files

Adding paintDocumentFooter and paintDocumentHeader to CakeBaseReporte…

…r and CakeHtmlReporter.

Refactoring case list and group lists to use reporter methods.
  • Loading branch information...
1 parent c01276a commit 4c0d90c50290d6fa403296171f4f46e0f81ed6c4 @markstory markstory committed Jan 7, 2010
@@ -136,7 +136,11 @@ function _checkXdebug() {
* @return void
*/
function _testCaseList() {
+ $Reporter =& $this->getReporter();
+ $Reporter->paintDocumentHeader();
+ $Reporter->paintTestMenu();
CakeTestMenu::testCaseList();
+ $Reporter->paintDocumentEnd();
}
/**
@@ -145,7 +149,11 @@ function _testCaseList() {
* @return void
*/
function _groupTestList() {
+ $Reporter =& $this->getReporter();
+ $Reporter->paintDocumentHeader();
+ $Reporter->paintTestMenu();
CakeTestMenu::groupTestList();
+ $Reporter->paintDocumentEnd();
}
/**
@@ -107,6 +107,26 @@ function testCaseList() {
* @return void
*/
function groupTestList() {
+
+ }
+
+/**
+ * paints the header of the response from the test suite.
+ * Used to paint things like head elements in an html page.
+ *
+ * @return void
+ */
+ function paintDocumentHeader() {
+
+ }
+
+/**
+ * paints the end of the response from the test suite.
+ * Used to paint things like </body> in an html page.
+ *
+ * @return void
+ */
+ function paintDocumentFooter() {
}
@@ -177,8 +177,7 @@ function paintFooter($test_name) {
}
echo $this->_paintLinks();
echo '</div>';
- $baseDir = $this->params['baseDir'];
- include CAKE_TESTS_LIB . 'templates' . DS . 'footer.php';
+ $this->paintDocumentEnd();
}
/**
@@ -211,6 +210,7 @@ function _paintLinks() {
echo "<p><a href='" . RUN_TEST_LINK . $show . "'>Run more tests</a> | <a href='" . RUN_TEST_LINK . $query . "&show_passes=1'>Show Passes</a> | \n";
echo " <a href='" . RUN_TEST_LINK . $query . "&amp;code_coverage=true'>Analyze Code Coverage</a></p>\n";
}
+
/**
* Convert an array of parameters into a query string url
*
@@ -228,6 +228,16 @@ function _queryString($url) {
}
/**
+ * paints the end of the document html.
+ *
+ * @return void
+ */
+ function paintDocumentEnd() {
+ $baseDir = $this->params['baseDir'];
+ include CAKE_TESTS_LIB . 'templates' . DS . 'footer.php';
+ }
+
+/**
* Paints the test failure with a breadcrumbs
* trail of the nesting test suites below the
* top level test.

0 comments on commit 4c0d90c

Please sign in to comment.