• internal This class is not covered by the backward compatibility promise for PHPUnit
CloneableInstantiable
ExtendsPHPUnit\Util\TestDox\TestDoxPrinter
PHPUnit\TextUI\ResultPrinter
PHPUnit\Util\Printer
ImplementsPHPUnit\Framework\TestListener
Constants
public PHPUnit\TextUI\ResultPrinter::COLOR_ALWAYS = 'always'
public PHPUnit\TextUI\ResultPrinter::COLOR_AUTO = 'auto'
public PHPUnit\TextUI\ResultPrinter::COLOR_DEFAULT = 'never'
public PHPUnit\TextUI\ResultPrinter::COLOR_NEVER = 'never'
public PHPUnit\TextUI\ResultPrinter::EVENT_TEST_END = 1
public PHPUnit\TextUI\ResultPrinter::EVENT_TEST_START = 0
public PHPUnit\TextUI\ResultPrinter::EVENT_TESTSUITE_END = 3
public PHPUnit\TextUI\ResultPrinter::EVENT_TESTSUITE_START = 2
Methods
public PHPUnit\Util\TestDox\TestDoxPrinter::__construct( $out = NULL, bool $verbose = false, string $colors = 'never', bool $debug = false, $numberOfColumns = 80, bool $reverse = false)
 
  • throws PHPUnit\Framework\Exception
public PHPUnit\Util\TestDox\TestDoxPrinter::addError(PHPUnit\Framework\Test $test, Throwable $t, float $time) : void
 
  • throws SebastianBergmann\RecursionContext\InvalidArgumentException
public PHPUnit\Util\TestDox\TestDoxPrinter::addFailure(PHPUnit\Framework\Test $test, PHPUnit\Framework\AssertionFailedError $e, float $time) : void
 
  • throws SebastianBergmann\RecursionContext\InvalidArgumentException
public PHPUnit\Util\TestDox\TestDoxPrinter::addIncompleteTest(PHPUnit\Framework\Test $test, Throwable $t, float $time) : void
 
  • throws SebastianBergmann\RecursionContext\InvalidArgumentException
public PHPUnit\Util\TestDox\TestDoxPrinter::addRiskyTest(PHPUnit\Framework\Test $test, Throwable $t, float $time) : void
 
  • throws SebastianBergmann\RecursionContext\InvalidArgumentException
public PHPUnit\Util\TestDox\TestDoxPrinter::addSkippedTest(PHPUnit\Framework\Test $test, Throwable $t, float $time) : void
 
  • throws SebastianBergmann\RecursionContext\InvalidArgumentException
public PHPUnit\Util\TestDox\TestDoxPrinter::addWarning(PHPUnit\Framework\Test $test, PHPUnit\Framework\Warning $e, float $time) : void
 
  • throws SebastianBergmann\RecursionContext\InvalidArgumentException
public PHPUnit\Util\TestDox\TestDoxPrinter::endTest(PHPUnit\Framework\Test $test, float $time) : void
 
  • throws SebastianBergmann\RecursionContext\InvalidArgumentException
public PHPUnit\TextUI\ResultPrinter::endTestSuite(PHPUnit\Framework\TestSuite $suite) : void
 

A testsuite ended.

public PHPUnit\Util\TestDox\TestDoxPrinter::flush() : void
public PHPUnit\Util\Printer::getAutoFlush() : bool
 

Check auto-flush mode.

public PHPUnit\Util\Printer::incrementalFlush() : void
 

Performs a safe, incremental flush.

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.

public printResult(PHPUnit\Framework\TestResult $result) : void
 
  • throws SebastianBergmann\Timer\RuntimeException
public PHPUnit\Util\Printer::setAutoFlush(bool $autoFlush) : void
 

Set auto-flushing mode.

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

public PHPUnit\Util\TestDox\TestDoxPrinter::setOriginalExecutionOrder(array $order) : void
public PHPUnit\Util\TestDox\TestDoxPrinter::setShowProgressAnimation(bool $showProgress) : void
public PHPUnit\TextUI\ResultPrinter::startTest(PHPUnit\Framework\Test $test) : void
 

A test started.

public PHPUnit\TextUI\ResultPrinter::startTestSuite(PHPUnit\Framework\TestSuite $suite) : void
 

A testsuite started.

public PHPUnit\Util\Printer::write(string $buffer) : void
public PHPUnit\Util\TestDox\TestDoxPrinter::writeProgress(string $progress) : void
Properties
protected PHPUnit\Util\Printer::$autoFlush
 

If true, flush output after every write.

  • var bool
protected PHPUnit\TextUI\ResultPrinter::$colors
 
  • var bool
protected PHPUnit\TextUI\ResultPrinter::$column
 
  • var int
protected PHPUnit\TextUI\ResultPrinter::$debug
 
  • var bool
protected PHPUnit\Util\TestDox\TestDoxPrinter::$enableOutputBuffer
 
  • var bool
protected PHPUnit\TextUI\ResultPrinter::$lastTestFailed
 
  • var bool
protected PHPUnit\TextUI\ResultPrinter::$maxColumn
 
  • var int
protected PHPUnit\TextUI\ResultPrinter::$numAssertions
 
  • var int
protected PHPUnit\TextUI\ResultPrinter::$numTests
 
  • var int
protected PHPUnit\TextUI\ResultPrinter::$numTestsRun
 
  • var int
protected PHPUnit\TextUI\ResultPrinter::$numTestsWidth
 
  • var int
protected PHPUnit\Util\TestDox\TestDoxPrinter::$originalExecutionOrder
 
  • var array array
protected PHPUnit\Util\Printer::$out
 
  • var resource
protected PHPUnit\Util\Printer::$outTarget
 
  • var string
protected PHPUnit\Util\TestDox\TestDoxPrinter::$prettifier
protected PHPUnit\Util\TestDox\TestDoxPrinter::$showProgress
 
  • var bool
protected PHPUnit\Util\TestDox\TestDoxPrinter::$spinState
 
  • var int
protected PHPUnit\Util\TestDox\TestDoxPrinter::$testFlushIndex
 
  • var int The number of test results already sent to the output
protected PHPUnit\Util\TestDox\TestDoxPrinter::$testIndex
 
  • var int The number of test results received from the TestRunner
protected PHPUnit\Util\TestDox\TestDoxPrinter::$testNameResultIndex
 
  • var array Lookup table for testname to testResults[index]
protected PHPUnit\Util\TestDox\TestDoxPrinter::$testResults
 
  • var array Buffer for test results
protected PHPUnit\TextUI\ResultPrinter::$verbose
 
  • var bool
Methods
protected colorizeMessageAndDiff(string $style, string $buffer) : array
protected PHPUnit\TextUI\ResultPrinter::colorizeTextBox(string $color, string $buffer) : string
 

Formats a buffer with a specified ANSI color sequence if colors are
enabled.

protected drawSpinner() : void
protected PHPUnit\Util\TestDox\TestDoxPrinter::flushOutputBuffer(bool $forceFlush = false) : void
protected formatClassName(PHPUnit\Framework\Test $test) : string
protected formatStacktrace(Throwable $t) : string
protected formatTestName(PHPUnit\Framework\Test $test) : string
 
  • throws SebastianBergmann\RecursionContext\InvalidArgumentException
protected formatTestResultMessage(Throwable $t, array $result, ?string $prefix = NULL) : string
protected formatThrowable(Throwable $t, ?int $status = NULL) : string
protected PHPUnit\Util\TestDox\TestDoxPrinter::getEmptyTestResult() : array
protected PHPUnit\Util\TestDox\TestDoxPrinter::getTestResultByName(?string $testName) : array
protected PHPUnit\Util\TestDox\TestDoxPrinter::hideSpinner() : void
protected PHPUnit\Util\TestDox\TestDoxPrinter::prefixLines(string $prefix, string $message) : string
protected PHPUnit\TextUI\ResultPrinter::printDefect(PHPUnit\Framework\TestFailure $defect, int $count) : void
protected PHPUnit\TextUI\ResultPrinter::printDefectHeader(PHPUnit\Framework\TestFailure $defect, int $count) : void
protected PHPUnit\TextUI\ResultPrinter::printDefects(array $defects, string $type) : void
protected PHPUnit\TextUI\ResultPrinter::printDefectTrace(PHPUnit\Framework\TestFailure $defect) : void
protected PHPUnit\TextUI\ResultPrinter::printErrors(PHPUnit\Framework\TestResult $result) : void
protected PHPUnit\TextUI\ResultPrinter::printFailures(PHPUnit\Framework\TestResult $result) : void
protected PHPUnit\TextUI\ResultPrinter::printFooter(PHPUnit\Framework\TestResult $result) : void
protected printHeader() : void
 
  • throws SebastianBergmann\Timer\RuntimeException
protected PHPUnit\TextUI\ResultPrinter::printIncompletes(PHPUnit\Framework\TestResult $result) : void
protected PHPUnit\TextUI\ResultPrinter::printRisky(PHPUnit\Framework\TestResult $result) : void
protected PHPUnit\TextUI\ResultPrinter::printSkipped(PHPUnit\Framework\TestResult $result) : void
protected PHPUnit\TextUI\ResultPrinter::printWarnings(PHPUnit\Framework\TestResult $result) : void
protected registerTestResult(PHPUnit\Framework\Test $test, ?Throwable $t, int $status, float $time, bool $verbose) : void
 
  • throws SebastianBergmann\RecursionContext\InvalidArgumentException
protected PHPUnit\Util\TestDox\TestDoxPrinter::showSpinner() : void
protected PHPUnit\Util\TestDox\TestDoxPrinter::testHasPassed() : bool
protected undrawSpinner() : void
protected PHPUnit\TextUI\ResultPrinter::writeNewLine() : void
protected PHPUnit\TextUI\ResultPrinter::writeProgressWithColor(string $color, string $buffer) : void
 

Writes progress with a color sequence if colors are enabled.

protected writeTestResult(array $prevResult, array $result) : void
protected PHPUnit\TextUI\ResultPrinter::writeWithColor(string $color, string $buffer, bool $lf = true) : void
 

Writes a buffer out with a color sequence if colors are enabled.

Constants
private PHPUnit\Util\TestDox\CliTestDoxPrinter::PREFIX_DECORATED = ['default' => '│', 'start' => '┐', 'message' => '├', 'diff' => '┊', 'trace' => '╵', 'last' => '┴']
 

Colored Testdox use box-drawing for a more textured map of the message

private PHPUnit\Util\TestDox\CliTestDoxPrinter::PREFIX_SIMPLE = ['default' => '│', 'start' => '│', 'message' => '│', 'diff' => '│', 'trace' => '│', 'last' => '│']
 

The default Testdox left margin for messages is a vertical line

private PHPUnit\Util\TestDox\CliTestDoxPrinter::SPINNER_ICONS = [' ◐ running tests', ' ◓ running tests', ' ◑ running tests', ' ◒ running tests']
private PHPUnit\Util\TestDox\CliTestDoxPrinter::STATUS_STYLES = [['symbol' => '✔', 'color' => 'fg-green'], 4 => ['symbol' => '✘', 'color' => 'fg-yellow', 'message' => 'bg-yellow,fg-black'], 3 => ['symbol' => '✘', 'color' => 'fg-red', 'message' => 'bg-red,fg-white'], 1 => ['symbol' => '↩', 'color' => 'fg-cyan', 'message' => 'fg-cyan'], 5 => ['symbol' => '☢', 'color' => 'fg-yellow', 'message' => 'fg-yellow'], 2 => ['symbol' => '∅', 'color' => 'fg-yellow', 'message' => 'fg-yellow'], ['symbol' => '⚠', 'color' => 'fg-yellow', 'message' => 'fg-yellow'], -1 => ['symbol' => '?', 'color' => 'fg-blue', 'message' => 'fg-white,bg-blue']]
Properties
private $nonSuccessfulTestResults
 
  • var int[]
Methods
private formatRuntime(float $time, string $color = '') : string
private printNonSuccessfulTestsSummary(int $numberOfExecutedTests) : void
private PHPUnit\TextUI\ResultPrinter::writeCountString(int $count, string $name, string $color, bool $always = false) : void
© 2020 Bruce Wells
Search Namespaces \ Classes
ConfigurationNumbers (0-9.) only