assertRegExp('/
/', $result);
foreach ($file as $i => $line) {
$this->assertTrue(strpos($line, $result) !== 0, 'Content is missing ' . $i);
@@ -167,7 +167,7 @@ class HtmlCoverageReportTest extends CakeTestCase {
$result = $this->Coverage->generateDiff('myfile.php', $file, $coverage);
$this->assertRegExp('/myfile\.php Code coverage\: \d+\.?\d*\%/', $result);
- $this->assertRegExp('/assertRegExp('/
assertRegExp('/
/', $result);
foreach ($file as $i => $line) {
$this->assertTrue(strpos($line, $result) !== 0, 'Content is missing ' . $i);
diff --git a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
index 8f83f8521..0d194f795 100644
--- a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
+++ b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
@@ -200,6 +200,7 @@ HTML;
* @return string
*/
public function coverageHeader($filename, $percent) {
+ $hash = md5($filename);
$filename = basename($filename);
list($file) = explode('.', $filename);
$display = in_array($file, $this->_testNames) ? 'block' : 'none';
@@ -207,11 +208,11 @@ HTML;
return <<
-
+
HTML;
}
diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
index d67373682..3e68005f3 100644
--- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
+++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
@@ -199,12 +199,12 @@ class CakeHtmlReporter extends CakeBaseReporter {
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";
}
/**
@@ -248,7 +248,8 @@ class CakeHtmlReporter extends CakeBaseReporter {
*/
public function paintFail($message, $test) {
$trace = $this->_getStackTrace($message);
- $testName = get_class($test) . '(' . $test->getName() . ')';
+ $className = get_class($test);
+ $testName = $className . '::' . $test->getName() . '()';
$actualMsg = $expectedMsg = null;
if (method_exists($message, 'getComparisonFailure')) {
@@ -269,6 +270,10 @@ class CakeHtmlReporter extends CakeBaseReporter {
echo "
\n";
echo "
" . __d('cake_dev', 'Test case: %s', $testName) . "
\n";
+ if (strpos($className, "PHPUnit_") === false) {
+ list($show, $query) = $this->_getQueryLink();
+ echo "
\n";
+ }
echo "
" . __d('cake_dev', 'Stack trace:') . '
' . $trace . "
\n";
echo "\n";
}
@@ -380,4 +385,32 @@ class CakeHtmlReporter extends CakeBaseReporter {
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);
+ }
+
}