CustomPrinter
extends PHPUnit_TextUI_ResultPrinter
in package
Prints the result of a TextUI TestRunner run.
Table of Contents
- COLOR_ALWAYS = 'always'
- COLOR_AUTO = 'auto'
- COLOR_DEFAULT = self::COLOR_NEVER
- COLOR_NEVER = 'never'
- EVENT_TEST_END = 1
- EVENT_TEST_START = 0
- EVENT_TESTSUITE_END = 3
- EVENT_TESTSUITE_START = 2
- $autoFlush : bool
- If true, flush output after every write.
- $colors : bool
- $column : int
- $debug : bool
- $lastTestFailed : bool
- $maxColumn : int
- $numAssertions : int
- $numTests : int
- $numTestsRun : int
- $numTestsWidth : int
- $out : resource
- $outTarget : string
- $printsHTML : bool
- $verbose : bool
- $ansiCodes : array<string|int, mixed>
- $numberOfColumns : int
- __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, optionally tidy up HTML, and close output if it's not to a php stream
- getAutoFlush() : bool
- Check auto-flush mode.
- incrementalFlush() : mixed
- Performs a safe, incremental flush.
- printResult() : mixed
- printWaitPrompt() : mixed
- setAutoFlush() : mixed
- Set auto-flushing mode.
- startTest() : mixed
- A test started.
- startTestSuite() : mixed
- A testsuite started.
- write() : mixed
- formatWithColor() : string
- Formats a buffer with a specified ANSI color sequence if colors are enabled.
- printDefect() : mixed
- printDefectHeader() : mixed
- printDefects() : mixed
- printDefectTrace() : mixed
- printErrors() : mixed
- printFailures() : mixed
- printFooter() : mixed
- printHeader() : mixed
- printIncompletes() : mixed
- printRisky() : mixed
- printSkipped() : mixed
- writeNewLine() : mixed
- writeProgress() : mixed
- writeProgressWithColor() : mixed
- Writes progress with a color sequence if colors are enabled.
- writeWithColor() : mixed
- Writes a buffer out with a color sequence if colors are enabled.
- writeCountString() : mixed
Constants
COLOR_ALWAYS
public
mixed
COLOR_ALWAYS
= 'always'
COLOR_AUTO
public
mixed
COLOR_AUTO
= 'auto'
COLOR_DEFAULT
public
mixed
COLOR_DEFAULT
= self::COLOR_NEVER
COLOR_NEVER
public
mixed
COLOR_NEVER
= 'never'
EVENT_TEST_END
public
mixed
EVENT_TEST_END
= 1
EVENT_TEST_START
public
mixed
EVENT_TEST_START
= ""
EVENT_TESTSUITE_END
public
mixed
EVENT_TESTSUITE_END
= 3
EVENT_TESTSUITE_START
public
mixed
EVENT_TESTSUITE_START
= 2
Properties
$autoFlush
If true, flush output after every write.
protected
bool
$autoFlush
= alse
$colors
protected
bool
$colors
= alse
$column
protected
int
$column
= 0
$debug
protected
bool
$debug
= alse
$lastTestFailed
protected
bool
$lastTestFailed
= alse
$maxColumn
protected
int
$maxColumn
$numAssertions
protected
int
$numAssertions
= 0
$numTests
protected
int
$numTests
= -1
$numTestsRun
protected
int
$numTestsRun
= 0
$numTestsWidth
protected
int
$numTestsWidth
$out
protected
resource
$out
$outTarget
protected
string
$outTarget
$printsHTML
protected
bool
$printsHTML
= alse
$verbose
protected
bool
$verbose
= alse
$ansiCodes
private
static array<string|int, mixed>
$ansiCodes
= array('bold' => 1, 'fg-black' => 30, 'fg-red' => 31, 'fg-green' => 32, 'fg-yellow' => 33, 'fg-blue' => 34, 'fg-magenta' => 35, 'fg-cyan' => 36, 'fg-white' => 37, 'bg-black' => 40, 'bg-red' => 41, 'bg-green' => 42, 'bg-yellow' => 43, 'bg-blue' => 44, 'bg-magenta' => 45, 'bg-cyan' => 46, 'bg-white' => 47)
$numberOfColumns
private
int
$numberOfColumns
Methods
__construct()
Constructor.
public
__construct([mixed $out = null ]) : mixed
Parameters
- $out : mixed = null
Tags
Return values
mixed —addError()
An error occurred.
public
addError(PHPUnit_Framework_Test $test, Exception $e, float $time) : mixed
Parameters
- $test : PHPUnit_Framework_Test
- $e : Exception
- $time : float
Return values
mixed —addFailure()
A failure occurred.
public
addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time) : mixed
Parameters
- $test : PHPUnit_Framework_Test
- $e : PHPUnit_Framework_AssertionFailedError
- $time : float
Return values
mixed —addIncompleteTest()
Incomplete test.
public
addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, float $time) : mixed
Parameters
- $test : PHPUnit_Framework_Test
- $e : Exception
- $time : float
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
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
Return values
mixed —endTest()
A test ended.
public
endTest(PHPUnit_Framework_Test $test, float $time) : mixed
Parameters
- $test : PHPUnit_Framework_Test
- $time : float
Return values
mixed —endTestSuite()
A testsuite ended.
public
endTestSuite(PHPUnit_Framework_TestSuite $suite) : mixed
Parameters
- $suite : PHPUnit_Framework_TestSuite
Tags
Return values
mixed —flush()
Flush buffer, optionally tidy up HTML, and close output if it's not to a php stream
public
flush() : mixed
Return values
mixed —getAutoFlush()
Check auto-flush mode.
public
getAutoFlush() : bool
Tags
Return values
bool —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
Return values
mixed —printResult()
public
printResult(PHPUnit_Framework_TestResult $result) : mixed
Parameters
- $result : PHPUnit_Framework_TestResult
Return values
mixed —printWaitPrompt()
public
printWaitPrompt() : mixed
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
Return values
mixed —startTest()
A test started.
public
startTest(PHPUnit_Framework_Test $test) : mixed
Parameters
- $test : PHPUnit_Framework_Test
Return values
mixed —startTestSuite()
A testsuite started.
public
startTestSuite(PHPUnit_Framework_TestSuite $suite) : mixed
Parameters
- $suite : PHPUnit_Framework_TestSuite
Tags
Return values
mixed —write()
public
write(string $buffer) : mixed
Parameters
- $buffer : string
Return values
mixed —formatWithColor()
Formats a buffer with a specified ANSI color sequence if colors are enabled.
protected
formatWithColor(string $color, string $buffer) : string
Parameters
- $color : string
- $buffer : string
Tags
Return values
string —printDefect()
protected
printDefect(PHPUnit_Framework_TestFailure $defect, int $count) : mixed
Parameters
- $defect : PHPUnit_Framework_TestFailure
- $count : int
Return values
mixed —printDefectHeader()
protected
printDefectHeader(PHPUnit_Framework_TestFailure $defect, int $count) : mixed
Parameters
- $defect : PHPUnit_Framework_TestFailure
- $count : int
Return values
mixed —printDefects()
protected
printDefects(array<string|int, mixed> $defects, string $type) : mixed
Parameters
- $defects : array<string|int, mixed>
- $type : string
Return values
mixed —printDefectTrace()
protected
printDefectTrace(PHPUnit_Framework_TestFailure $defect) : mixed
Parameters
- $defect : PHPUnit_Framework_TestFailure
Return values
mixed —printErrors()
protected
printErrors(PHPUnit_Framework_TestResult $result) : mixed
Parameters
- $result : PHPUnit_Framework_TestResult
Return values
mixed —printFailures()
protected
printFailures(PHPUnit_Framework_TestResult $result) : mixed
Parameters
- $result : PHPUnit_Framework_TestResult
Return values
mixed —printFooter()
protected
printFooter(PHPUnit_Framework_TestResult $result) : mixed
Parameters
- $result : PHPUnit_Framework_TestResult
Return values
mixed —printHeader()
protected
printHeader() : mixed
Return values
mixed —printIncompletes()
protected
printIncompletes(PHPUnit_Framework_TestResult $result) : mixed
Parameters
- $result : PHPUnit_Framework_TestResult
Return values
mixed —printRisky()
protected
printRisky(PHPUnit_Framework_TestResult $result) : mixed
Parameters
- $result : PHPUnit_Framework_TestResult
Tags
Return values
mixed —printSkipped()
protected
printSkipped(PHPUnit_Framework_TestResult $result) : mixed
Parameters
- $result : PHPUnit_Framework_TestResult
Tags
Return values
mixed —writeNewLine()
protected
writeNewLine() : mixed
Return values
mixed —writeProgress()
protected
writeProgress(string $progress) : mixed
Parameters
- $progress : string
Return values
mixed —writeProgressWithColor()
Writes progress with a color sequence if colors are enabled.
protected
writeProgressWithColor(string $color, string $buffer) : mixed
Parameters
- $color : string
- $buffer : string
Tags
Return values
mixed —writeWithColor()
Writes a buffer out with a color sequence if colors are enabled.
protected
writeWithColor(string $color, string $buffer[, bool $lf = true ]) : mixed
Parameters
- $color : string
- $buffer : string
- $lf : bool = true
Tags
Return values
mixed —writeCountString()
private
writeCountString(int $count, string $name, string $color[, bool $always = false ]) : mixed
Parameters
- $count : int
- $name : string
- $color : string
- $always : bool = false