Lggr
Public Member Functions | Protected Attributes | List of all members
PHPUnit\Util\Log\JUnit Class Reference
Inheritance diagram for PHPUnit\Util\Log\JUnit:
Inheritance graph
[legend]
Collaboration diagram for PHPUnit\Util\Log\JUnit:
Collaboration graph
[legend]

Public Member Functions

 __construct ($out=null, $reportUselessTests=false)
 
 flush ()
 
 addError (Test $test, \Exception $e, $time)
 
 addWarning (Test $test, Warning $e, $time)
 
 addFailure (Test $test, AssertionFailedError $e, $time)
 
 addIncompleteTest (Test $test, \Exception $e, $time)
 
 addRiskyTest (Test $test, \Exception $e, $time)
 
 addSkippedTest (Test $test, \Exception $e, $time)
 
 startTestSuite (TestSuite $suite)
 
 endTestSuite (TestSuite $suite)
 
 startTest (Test $test)
 
 endTest (Test $test, $time)
 
 getXML ()
 
 setWriteDocument ($flag)
 
- Public Member Functions inherited from PHPUnit\Util\Printer
 __construct ($out=null)
 
 incrementalFlush ()
 
 write ($buffer)
 
 getAutoFlush ()
 
 setAutoFlush ($autoFlush)
 
- Public Member Functions inherited from PHPUnit\Framework\TestListener
 addWarning (Test $test, Warning $e, $time)
 

Protected Attributes

 $document
 
 $root
 
 $reportUselessTests = false
 
 $writeDocument = true
 
 $testSuites = []
 
 $testSuiteTests = [0]
 
 $testSuiteAssertions = [0]
 
 $testSuiteErrors = [0]
 
 $testSuiteFailures = [0]
 
 $testSuiteSkipped = [0]
 
 $testSuiteTimes = [0]
 
 $testSuiteLevel = 0
 
 $currentTestCase
 
- Protected Attributes inherited from PHPUnit\Util\Printer
 $autoFlush = false
 
 $out
 
 $outTarget
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __construct()

PHPUnit\Util\Log\JUnit::__construct (   $out = null,
  $reportUselessTests = false 
)

Constructor.

Parameters
mixed$out
bool$reportUselessTests

Member Function Documentation

◆ addError()

PHPUnit\Util\Log\JUnit::addError ( Test  $test,
\Exception  $e,
  $time 
)

An error occurred.

Parameters
Test$test
\Exception$e
float$time

Implements PHPUnit\Framework\TestListener.

◆ addFailure()

PHPUnit\Util\Log\JUnit::addFailure ( Test  $test,
AssertionFailedError  $e,
  $time 
)

A failure occurred.

Parameters
Test$test
AssertionFailedError$e
float$time

Implements PHPUnit\Framework\TestListener.

◆ addIncompleteTest()

PHPUnit\Util\Log\JUnit::addIncompleteTest ( Test  $test,
\Exception  $e,
  $time 
)

Incomplete test.

Parameters
Test$test
\Exception$e
float$time

Implements PHPUnit\Framework\TestListener.

◆ addRiskyTest()

PHPUnit\Util\Log\JUnit::addRiskyTest ( Test  $test,
\Exception  $e,
  $time 
)

Risky test.

Parameters
Test$test
\Exception$e
float$time

Implements PHPUnit\Framework\TestListener.

◆ addSkippedTest()

PHPUnit\Util\Log\JUnit::addSkippedTest ( Test  $test,
\Exception  $e,
  $time 
)

Skipped test.

Parameters
Test$test
\Exception$e
float$time

Implements PHPUnit\Framework\TestListener.

◆ addWarning()

PHPUnit\Util\Log\JUnit::addWarning ( Test  $test,
Warning  $e,
  $time 
)

A warning occurred.

Parameters
Test$test
Warning$e
float$time

◆ endTest()

PHPUnit\Util\Log\JUnit::endTest ( Test  $test,
  $time 
)

A test ended.

Parameters
Test$test
float$time

Implements PHPUnit\Framework\TestListener.

◆ endTestSuite()

PHPUnit\Util\Log\JUnit::endTestSuite ( TestSuite  $suite)

A testsuite ended.

Parameters
TestSuite$suite

Implements PHPUnit\Framework\TestListener.

◆ flush()

PHPUnit\Util\Log\JUnit::flush ( )

Flush buffer and close output.

Reimplemented from PHPUnit\Util\Printer.

◆ getXML()

PHPUnit\Util\Log\JUnit::getXML ( )

Returns the XML as a string.

Returns
string

◆ setWriteDocument()

PHPUnit\Util\Log\JUnit::setWriteDocument (   $flag)

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

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

Returns
string

◆ startTest()

PHPUnit\Util\Log\JUnit::startTest ( Test  $test)

A test started.

Parameters
Test$test

Implements PHPUnit\Framework\TestListener.

◆ startTestSuite()

PHPUnit\Util\Log\JUnit::startTestSuite ( TestSuite  $suite)

A testsuite started.

Parameters
TestSuite$suite

Implements PHPUnit\Framework\TestListener.


The documentation for this class was generated from the following file: