|
From: Marcus B. <ma...@wo...> - 2009-03-15 11:27:04
|
Hi...
Gabor Szabo wrote:
> 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 {
> ...
> }
> ?>
You don't anymore. I'm in the process of correcting all the docs prior
to the SimpleTest 1.1 release. I'm working through in alphabetical order
and I'm up to "M". It will take another couple of weeks at current rate.
> I tried to add that code and access the page via the browser but I still
> got the HTML Report.
The autorun mechanism has three modes (one triggered by the --xml flag).
I couldn't see a need to have text mode in a browser or vice versa, so
that's not currently supported.
The prefer() system (?!) works on subclasses of HtmlRporter,
TextReporter or XmlReporter and sniffs the perefered class to determine
which on it subclasses. Right now it's a bit of a beta quality hack.
Later it will look for interfaces as well.
>
> 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?
It is supposed to work like that. Right now there is no way to override
it to have the TextReporter in the browser. I didn't think it would be
necessary. Do you need this?
>
> Gabor
yours, Marcus
|