|
From: Gabor S. <sz...@gm...> - 2009-03-15 07:29:46
|
I was trying to understand how the switching between TextReport and
HTMLReport work
and I could not get it work so far.
When I access test.php in the browser I get the nice report with the
red line, it is clear it sent me
HTML.
When I run the $ php test.php I get a textual report. So autorun
recognized that I am running it on the
command line and automatically switched to the TextReporter. This is nice.
So I wondered when would I need to write
<?php
require_once('simpletest/autorun.php');
SimpleTest :: prefer(new TextReporter());
require_once('../classes/writer.php');
class FileTestCase extends UnitTestCase {
...
}
?>
mentioned at the bottom of
http://simpletest.org/en/unit_test_documentation.html ?
I tried to add that code and access the page via the browser but I still
got the HTML Report.
I managed to extend both TextReporter and HTMLReporter to show the passes
as the example on http://simpletest.org/en/reporter_documentation.html shows
but The TextReporer extension was only taking effect when I ran on the command
line while the HTML::Reporter extension worked only in the browser.
Is this a feature a bug or an incorrect usage on my side?
Gabor
|