PHP Class PHPUnit_TextUI_ResultPrinter, phpunit

Author: Sebastian Bergmann ([email protected])
Inheritance: extends PHPUnit_Util_Printer, implements PHPUnit_Framework_TestListener
Show file Open project: sebastianbergmann/phpunit Class Usage Examples

Protected Properties

Property Type Description
$colors boolean
$column integer
$debug boolean
$lastTestFailed boolean
$maxColumn integer
$numAssertions integer
$numTests integer
$numTestsRun integer
$numTestsWidth integer
$verbose boolean

Public Methods

Method Description
__construct ( mixed $out = null, boolean $verbose = false, string $colors = self::COLOR_DEFAULT, boolean $debug = false, integer | string $numberOfColumns = 80, boolean $reverse = false ) Constructor.
addError ( PHPUnit_Framework_Test $test, Exception $e, float $time ) An error occurred.
addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time ) A failure occurred.
addIncompleteTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) Incomplete test.
addRiskyTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) Risky test.
addSkippedTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) Skipped test.
addWarning ( PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, float $time ) A warning occurred.
endTest ( PHPUnit_Framework_Test $test, float $time ) A test ended.
endTestSuite ( PHPUnit_Framework_TestSuite $suite ) A testsuite ended.
printResult ( PHPUnit_Framework_TestResult $result )
printWaitPrompt ( )
startTest ( PHPUnit_Framework_Test $test ) A test started.
startTestSuite ( PHPUnit_Framework_TestSuite $suite ) A testsuite started.

Protected Methods

Method Description
formatWithColor ( string $color, string $buffer ) : string Formats a buffer with a specified ANSI color sequence if colors are enabled.
printDefect ( PHPUnit_Framework_TestFailure $defect, integer $count )
printDefectHeader ( PHPUnit_Framework_TestFailure $defect, integer $count )
printDefectTrace ( PHPUnit_Framework_TestFailure $defect )
printDefects ( array $defects, string $type )
printErrors ( PHPUnit_Framework_TestResult $result )
printFailures ( PHPUnit_Framework_TestResult $result )
printFooter ( PHPUnit_Framework_TestResult $result )
printHeader ( )
printIncompletes ( PHPUnit_Framework_TestResult $result )
printRisky ( PHPUnit_Framework_TestResult $result )
printSkipped ( PHPUnit_Framework_TestResult $result )
printWarnings ( PHPUnit_Framework_TestResult $result )
writeNewLine ( )
writeProgress ( string $progress )
writeProgressWithColor ( string $color, string $buffer ) Writes progress with a color sequence if colors are enabled.
writeWithColor ( string $color, string $buffer, boolean $lf = true ) Writes a buffer out with a color sequence if colors are enabled.

Private Methods

Method Description
writeCountString ( integer $count, string $name, string $color, boolean $always = false )

Method Details

__construct() public method

Constructor.
public __construct ( mixed $out = null, boolean $verbose = false, string $colors = self::COLOR_DEFAULT, boolean $debug = false, integer | string $numberOfColumns = 80, boolean $reverse = false )
$out mixed
$verbose boolean
$colors string
$debug boolean
$numberOfColumns integer | string
$reverse boolean

addError() public method

An error occurred.
public addError ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addFailure() public method

A failure occurred.
public addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time )
$test PHPUnit_Framework_Test
$e PHPUnit_Framework_AssertionFailedError
$time float

addIncompleteTest() public method

Incomplete test.
public addIncompleteTest ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addRiskyTest() public method

Risky test.
public addRiskyTest ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addSkippedTest() public method

Skipped test.
public addSkippedTest ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addWarning() public method

A warning occurred.
public addWarning ( PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, float $time )
$test PHPUnit_Framework_Test
$e PHPUnit_Framework_Warning
$time float

endTest() public method

A test ended.
public endTest ( PHPUnit_Framework_Test $test, float $time )
$test PHPUnit_Framework_Test
$time float

endTestSuite() public method

A testsuite ended.
public endTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

formatWithColor() protected method

Formats a buffer with a specified ANSI color sequence if colors are enabled.
protected formatWithColor ( string $color, string $buffer ) : string
$color string
$buffer string
return string

printDefect() protected method

protected printDefect ( PHPUnit_Framework_TestFailure $defect, integer $count )
$defect PHPUnit_Framework_TestFailure
$count integer

printDefectHeader() protected method

protected printDefectHeader ( PHPUnit_Framework_TestFailure $defect, integer $count )
$defect PHPUnit_Framework_TestFailure
$count integer

printDefectTrace() protected method

protected printDefectTrace ( PHPUnit_Framework_TestFailure $defect )
$defect PHPUnit_Framework_TestFailure

printDefects() protected method

protected printDefects ( array $defects, string $type )
$defects array
$type string

printErrors() protected method

protected printErrors ( PHPUnit_Framework_TestResult $result )
$result PHPUnit_Framework_TestResult

printFailures() protected method

protected printFailures ( PHPUnit_Framework_TestResult $result )
$result PHPUnit_Framework_TestResult

printFooter() protected method

protected printFooter ( PHPUnit_Framework_TestResult $result )
$result PHPUnit_Framework_TestResult

printHeader() protected method

protected printHeader ( )

printIncompletes() protected method

protected printIncompletes ( PHPUnit_Framework_TestResult $result )
$result PHPUnit_Framework_TestResult

printResult() public method

public printResult ( PHPUnit_Framework_TestResult $result )
$result PHPUnit_Framework_TestResult

printRisky() protected method

protected printRisky ( PHPUnit_Framework_TestResult $result )
$result PHPUnit_Framework_TestResult

printSkipped() protected method

protected printSkipped ( PHPUnit_Framework_TestResult $result )
$result PHPUnit_Framework_TestResult

printWaitPrompt() public method

public printWaitPrompt ( )

printWarnings() protected method

protected printWarnings ( PHPUnit_Framework_TestResult $result )
$result PHPUnit_Framework_TestResult

startTest() public method

A test started.
public startTest ( PHPUnit_Framework_Test $test )
$test PHPUnit_Framework_Test

startTestSuite() public method

A testsuite started.
public startTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

writeNewLine() protected method

protected writeNewLine ( )

writeProgress() protected method

protected writeProgress ( string $progress )
$progress string

writeProgressWithColor() protected method

Writes progress with a color sequence if colors are enabled.
protected writeProgressWithColor ( string $color, string $buffer )
$color string
$buffer string

writeWithColor() protected method

Writes a buffer out with a color sequence if colors are enabled.
protected writeWithColor ( string $color, string $buffer, boolean $lf = true )
$color string
$buffer string
$lf boolean

Property Details

$colors protected property

protected bool $colors
return boolean

$column protected property

protected int $column
return integer

$debug protected property

protected bool $debug
return boolean

$lastTestFailed protected property

protected bool $lastTestFailed
return boolean

$maxColumn protected property

protected int $maxColumn
return integer

$numAssertions protected property

protected int $numAssertions
return integer

$numTests protected property

protected int $numTests
return integer

$numTestsRun protected property

protected int $numTestsRun
return integer

$numTestsWidth protected property

protected int $numTestsWidth
return integer

$verbose protected property

protected bool $verbose
return boolean