diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php index f24444d34e6..9ac13cbea66 100644 --- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php @@ -199,12 +199,11 @@ protected function _paintLinks() { if (!empty($this->params['case'])) { $query['case'] = $this->params['case']; } - $show = $this->_queryString($show); - $query = $this->_queryString($query); + list($show, $query) = $this->_getQueryLink(); echo "

Run more tests | Show Passes | \n"; echo "Enable Debug Output | \n"; - echo "Analyze Code Coverage

\n"; + echo "Analyze Code Coverage | \n"; echo "All options enabled

\n"; } @@ -249,7 +248,7 @@ public function paintDocumentEnd() { */ public function paintFail($message, $test) { $trace = $this->_getStackTrace($message); - $testName = get_class($test) . '(' . $test->getName() . ')'; + $testName = get_class($test) . '::' . $test->getName() . '()'; $actualMsg = $expectedMsg = null; if (method_exists($message, 'getComparisonFailure')) { @@ -270,6 +269,8 @@ public function paintFail($message, $test) { echo "\n"; echo "
" . __d('cake_dev', 'Test case: %s', $testName) . "
\n"; + list($show, $query) = $this->_getQueryLink(); + echo "
" . __d('cake_dev', 'Rerun only this test: %s', $testName) . "
\n"; echo "
" . __d('cake_dev', 'Stack trace:') . '
' . $trace . "
\n"; echo "\n"; } @@ -381,4 +382,32 @@ public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { echo '

' . __d('cake_dev', 'Running %s', $suite->getName()) . '

'; } +/** + * Returns the query string formatted for ouput in links + * + * @return string + */ + protected function _getQueryLink() { + $show = $query = array(); + if (!empty($this->params['case'])) { + $show['show'] = 'cases'; + } + + if (!empty($this->params['core'])) { + $show['core'] = $query['core'] = 'true'; + } + if (!empty($this->params['plugin'])) { + $show['plugin'] = $query['plugin'] = $this->params['plugin']; + } + if (!empty($this->params['case'])) { + $query['case'] = $this->params['case']; + } + if (!empty($this->params['filter'])) { + $query['filter'] = $this->params['filter']; + } + $show = $this->_queryString($show); + $query = $this->_queryString($query); + return array( $show, $query ); + } + }