HtmlReporter::paintFooter PHP Method

paintFooter() public method

Paints the end of the test with a summary of the passes and failures.
public paintFooter ( string $test_name )
$test_name string Name class of test.
    public function paintFooter($test_name)
    {
        $colour = $this->getFailCount() + $this->getExceptionCount() > 0 ? 'red' : 'green';
        print '<div style="';
        print "padding: 8px; margin-top: 1em; background-color: {$colour}; color: white;";
        print '">';
        print $this->getTestCaseProgress() . '/' . $this->getTestCaseCount();
        print " test cases complete:\n";
        print '<strong>' . $this->getPassCount() . '</strong> passes, ';
        print '<strong>' . $this->getFailCount() . '</strong> fails and ';
        print '<strong>' . $this->getExceptionCount() . '</strong> exceptions.';
        print "</div>\n";
        print "</body>\n</html>\n";
    }

Usage Example

 function paintFooter($test_name)
 {
     $duration = microtime(true) - $this->_timer;
     $micro = round($duration - floor($duration), 2);
     $seconds = floor($duration);
     $minutes = floor($seconds / 60);
     $seconds = $seconds % 60;
     $d = $minutes ? $minutes . ' minute' . ($minutes > 1 ? 's ' : ' ') : '';
     $d .= $seconds + $micro . ' seconds';
     echo '<div style="border:1px solid orange; background: lightyellow; color:orange">Time taken: ' . $d . '</div>';
     parent::paintFooter($test_name);
 }
All Usage Examples Of HtmlReporter::paintFooter