JUnit
class JUnit extends Printer implements TestListener (View source)
A TestListener that generates a logfile of the test execution in XML markup.
The XML markup used is the same as the one that is used by the JUnit Ant task.
Properties
protected bool | $autoFlush | If true, flush output after every write. | from Printer |
protected resource | $out | from Printer | |
protected string | $outTarget | from Printer | |
protected DOMDocument | $document | ||
protected DOMElement | $root | ||
protected bool | $reportUselessTests | ||
protected bool | $writeDocument | ||
protected DOMElement[] | $testSuites | ||
protected int[] | $testSuiteTests | ||
protected int[] | $testSuiteAssertions | ||
protected int[] | $testSuiteErrors | ||
protected int[] | $testSuiteFailures | ||
protected int[] | $testSuiteSkipped | ||
protected int[] | $testSuiteTimes | ||
protected int | $testSuiteLevel | ||
protected ?DOMElement | $currentTestCase |
Methods
Constructor.
Flush buffer and close output.
Returns the XML as a string.
Enables or disables the writing of the document in flush().
Details
at line 107
__construct(mixed $out = null, bool $reportUselessTests = false)
Constructor.
at line 123
flush()
Flush buffer and close output.
incrementalFlush()
Performs a safe, incremental flush.
Do not confuse this function with the flush() function of this class, since the flush() function may close the file being written to, rendering the current object no longer usable.
setAutoFlush(bool $autoFlush)
Set auto-flushing mode.
If set, incremental flushes will be done after each write. This should not be confused with the different effects of this class' flush() method.
at line 165
addFailure(Test $test, AssertionFailedError $e, float $time)
A failure occurred.
at line 382
string
getXML()
Returns the XML as a string.
at line 396
string
setWriteDocument($flag)
Enables or disables the writing of the document in flush().
This is a "hack" needed for the integration of PHPUnit with Phing.