MediaWiki REL1_33
MediaWikiLoggerPHPUnitTestListener Class Reference

Replaces the logging SPI on each test run. More...

Inheritance diagram for MediaWikiLoggerPHPUnitTestListener:
Collaboration diagram for MediaWikiLoggerPHPUnitTestListener:

Public Member Functions

 addError (PHPUnit_Framework_Test $test, Exception $e, $time)
 
 addFailure (PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 
 addIncompleteTest (PHPUnit_Framework_Test $test, Exception $e, $time)
 
 addRiskyTest (PHPUnit_Framework_Test $test, Exception $e, $time)
 
 addSkippedTest (PHPUnit_Framework_Test $test, Exception $e, $time)
 
 addWarning (PHPUnit_Framework_Test $test, PHPUnit\Framework\Warning $e, $time)
 
 endTest (PHPUnit_Framework_Test $test, $time)
 A test ended.
 
 startTest (PHPUnit_Framework_Test $test)
 A test started.
 

Private Member Functions

 augmentTestWithLogs (PHPUnit_Framework_Test $test)
 
 formatLogs (array $logs)
 Get string formatted logs generated during the last test to execute.
 

Private Attributes

Spi null $originalSpi
 
Spi null $spi
 

Detailed Description

Replaces the logging SPI on each test run.

This allows another component (the printer) to fetch the logs when reporting why a test failed.

Definition at line 12 of file MediaWikiLoggerPHPUnitTestListener.php.

Member Function Documentation

◆ addError()

MediaWikiLoggerPHPUnitTestListener::addError ( PHPUnit_Framework_Test $test,
Exception $e,
$time )

Definition at line 42 of file MediaWikiLoggerPHPUnitTestListener.php.

References augmentTestWithLogs().

◆ addFailure()

MediaWikiLoggerPHPUnitTestListener::addFailure ( PHPUnit_Framework_Test $test,
PHPUnit_Framework_AssertionFailedError $e,
$time )

Definition at line 50 of file MediaWikiLoggerPHPUnitTestListener.php.

References augmentTestWithLogs().

◆ addIncompleteTest()

MediaWikiLoggerPHPUnitTestListener::addIncompleteTest ( PHPUnit_Framework_Test $test,
Exception $e,
$time )

Definition at line 34 of file MediaWikiLoggerPHPUnitTestListener.php.

References augmentTestWithLogs().

◆ addRiskyTest()

MediaWikiLoggerPHPUnitTestListener::addRiskyTest ( PHPUnit_Framework_Test $test,
Exception $e,
$time )

Definition at line 30 of file MediaWikiLoggerPHPUnitTestListener.php.

References augmentTestWithLogs().

◆ addSkippedTest()

MediaWikiLoggerPHPUnitTestListener::addSkippedTest ( PHPUnit_Framework_Test $test,
Exception $e,
$time )

Definition at line 38 of file MediaWikiLoggerPHPUnitTestListener.php.

References augmentTestWithLogs().

◆ addWarning()

MediaWikiLoggerPHPUnitTestListener::addWarning ( PHPUnit_Framework_Test $test,
PHPUnit\Framework\Warning $e,
$time )

Definition at line 46 of file MediaWikiLoggerPHPUnitTestListener.php.

References augmentTestWithLogs().

◆ augmentTestWithLogs()

MediaWikiLoggerPHPUnitTestListener::augmentTestWithLogs ( PHPUnit_Framework_Test $test)
private

◆ endTest()

MediaWikiLoggerPHPUnitTestListener::endTest ( PHPUnit_Framework_Test $test,
$time )

A test ended.

Parameters
PHPUnit_Framework_Test$test
float$time

Definition at line 70 of file MediaWikiLoggerPHPUnitTestListener.php.

◆ formatLogs()

MediaWikiLoggerPHPUnitTestListener::formatLogs ( array $logs)
private

Get string formatted logs generated during the last test to execute.

Parameters
array$logs
Returns
string

Definition at line 83 of file MediaWikiLoggerPHPUnitTestListener.php.

References and().

Referenced by augmentTestWithLogs().

◆ startTest()

MediaWikiLoggerPHPUnitTestListener::startTest ( PHPUnit_Framework_Test $test)

A test started.

Parameters
PHPUnit_Framework_Test$test

Definition at line 23 of file MediaWikiLoggerPHPUnitTestListener.php.

Member Data Documentation

◆ $originalSpi

Spi null MediaWikiLoggerPHPUnitTestListener::$originalSpi
private

Definition at line 14 of file MediaWikiLoggerPHPUnitTestListener.php.

◆ $spi

Spi null MediaWikiLoggerPHPUnitTestListener::$spi
private

Definition at line 16 of file MediaWikiLoggerPHPUnitTestListener.php.


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