Skip to content

Commit

Permalink
Added conditional to do not show rerun link if is warning of no test …
Browse files Browse the repository at this point in the history
…present

CS Fix

Update CakeHtmlReporter.php

Removed spaces in array return
  • Loading branch information
esteban-serfe authored and tranfuga25s committed Dec 26, 2014
1 parent 21f3a51 commit fe3d2b9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ public function paintDocumentEnd() {
*/
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')) {
Expand All @@ -269,8 +270,10 @@ public function paintFail($message, $test) {

echo "</pre></div>\n";
echo "<div class='msg'>" . __d('cake_dev', 'Test case: %s', $testName) . "</div>\n";
list($show, $query) = $this->_getQueryLink();
echo "<div class='msg'><a href='" . $this->baseUrl() . $query . "&amp;filter=" . $test->getName() . "'>" . __d('cake_dev', 'Rerun only this test: %s', $testName) . "</a></div>\n";
if (strpos($className, "PHPUnit_") === false) {
list($show, $query) = $this->_getQueryLink();
echo "<div class='msg'><a href='" . $this->baseUrl() . $query . "&amp;filter=" . $test->getName() . "'>" . __d('cake_dev', 'Rerun only this test: %s', $testName) . "</a></div>\n";
}
echo "<div class='msg'>" . __d('cake_dev', 'Stack trace:') . '<br />' . $trace . "</div>\n";
echo "</li>\n";
}
Expand Down Expand Up @@ -407,7 +410,7 @@ protected function _getQueryLink() {
}
$show = $this->_queryString($show);
$query = $this->_queryString($query);
return array( $show, $query );
return array($show, $query);
}

}

0 comments on commit fe3d2b9

Please sign in to comment.