Documentation

PHPUnit_Util_Log_JUnit extends PHPUnit_Util_Printer
in package
implements PHPUnit_Framework_TestListener

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.

Tags
since

Class available since Release 2.1.0

Interfaces, Classes and Traits

PHPUnit_Framework_TestListener
A Listener for test progress.

Table of Contents

$attachCurrentTestCase  : bool
$autoFlush  : bool
If true, flush output after every write.
$currentTestCase  : DOMElement
$document  : DOMDocument
$logIncompleteSkipped  : bool
$out  : resource
$outTarget  : string
$printsHTML  : bool
$root  : DOMElement
$testSuiteAssertions  : array<string|int, int>
$testSuiteErrors  : array<string|int, int>
$testSuiteFailures  : array<string|int, int>
$testSuiteLevel  : int
$testSuites  : array<string|int, DOMElement>
$testSuiteTests  : array<string|int, int>
$testSuiteTimes  : array<string|int, int>
$writeDocument  : bool
__construct()  : mixed
Constructor.
addError()  : mixed
An error occurred.
addFailure()  : mixed
A failure occurred.
addIncompleteTest()  : mixed
Incomplete test.
addRiskyTest()  : mixed
Risky test.
addSkippedTest()  : mixed
Skipped test.
endTest()  : mixed
A test ended.
endTestSuite()  : mixed
A testsuite ended.
flush()  : mixed
Flush buffer and close output.
getAutoFlush()  : bool
Check auto-flush mode.
getXML()  : string
Returns the XML as a string.
incrementalFlush()  : mixed
Performs a safe, incremental flush.
setAutoFlush()  : mixed
Set auto-flushing mode.
setWriteDocument()  : string
Enables or disables the writing of the document in flush().
startTest()  : mixed
A test started.
startTestSuite()  : mixed
A testsuite started.
write()  : mixed

Properties

$attachCurrentTestCase

protected bool $attachCurrentTestCase = rue

$autoFlush

If true, flush output after every write.

protected bool $autoFlush = alse

$currentTestCase

protected DOMElement $currentTestCase = ull

$document

protected DOMDocument $document

$logIncompleteSkipped

protected bool $logIncompleteSkipped = alse

$outTarget

protected string $outTarget

$printsHTML

protected bool $printsHTML = alse

$root

protected DOMElement $root

$testSuiteAssertions

protected array<string|int, int> $testSuiteAssertions = array(0)

$testSuiteErrors

protected array<string|int, int> $testSuiteErrors = array(0)

$testSuiteFailures

protected array<string|int, int> $testSuiteFailures = array(0)

$testSuiteLevel

protected int $testSuiteLevel = 0

$testSuites

protected array<string|int, DOMElement> $testSuites = array()

$testSuiteTests

protected array<string|int, int> $testSuiteTests = array(0)

$testSuiteTimes

protected array<string|int, int> $testSuiteTimes = array(0)

$writeDocument

protected bool $writeDocument = rue

Methods

__construct()

Constructor.

public __construct([mixed $out = null ][, bool $logIncompleteSkipped = false ]) : mixed
Parameters
$out : mixed = null
$logIncompleteSkipped : bool = false
Return values
mixed

addRiskyTest()

Risky test.

public addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, float $time) : mixed
Parameters
$test : PHPUnit_Framework_Test
$e : Exception
$time : float
Tags
since

Method available since Release 4.0.0

Return values
mixed

addSkippedTest()

Skipped test.

public addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, float $time) : mixed
Parameters
$test : PHPUnit_Framework_Test
$e : Exception
$time : float
Tags
since

Method available since Release 3.0.0

Return values
mixed

flush()

Flush buffer and close output.

public flush() : mixed
Return values
mixed

getAutoFlush()

Check auto-flush mode.

public getAutoFlush() : bool
Tags
since

Method available since Release 3.3.0

Return values
bool

getXML()

Returns the XML as a string.

public getXML() : string
Tags
since

Method available since Release 2.2.0

Return values
string

incrementalFlush()

Performs a safe, incremental flush.

public incrementalFlush() : mixed

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.

Tags
since

Method available since Release 3.3.0

Return values
mixed

setAutoFlush()

Set auto-flushing mode.

public setAutoFlush(bool $autoFlush) : mixed

If set, incremental flushes will be done after each write. This should not be confused with the different effects of this class' flush() method.

Parameters
$autoFlush : bool
Tags
since

Method available since Release 3.3.0

Return values
mixed

setWriteDocument()

Enables or disables the writing of the document in flush().

public setWriteDocument(mixed $flag) : string

This is a "hack" needed for the integration of PHPUnit with Phing.

Parameters
$flag : mixed
Tags
since

Method available since Release 2.2.0

Return values
string

write()

public write(string $buffer) : mixed
Parameters
$buffer : string
Return values
mixed

Search results