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

Public Member Functions

 __construct ($out=null, $verbose=false, $colors=self::COLOR_DEFAULT, $debug=false, $numberOfColumns=80, $reverse=false)
 
 printResult (TestResult $result)
 
 printWaitPrompt ()
 
 addError (Test $test, \Exception $e, $time)
 
 addFailure (Test $test, AssertionFailedError $e, $time)
 
 addWarning (Test $test, Warning $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)
 
- Public Member Functions inherited from PHPUnit\Util\Printer
 __construct ($out=null)
 
 flush ()
 
 incrementalFlush ()
 
 write ($buffer)
 
 getAutoFlush ()
 
 setAutoFlush ($autoFlush)
 

Public Attributes

const EVENT_TEST_START = 0
 
const EVENT_TEST_END = 1
 
const EVENT_TESTSUITE_START = 2
 
const EVENT_TESTSUITE_END = 3
 
const COLOR_NEVER = 'never'
 
const COLOR_AUTO = 'auto'
 
const COLOR_ALWAYS = 'always'
 
const COLOR_DEFAULT = self::COLOR_NEVER
 

Protected Member Functions

 printDefects (array $defects, $type)
 
 printDefect (TestFailure $defect, $count)
 
 printDefectHeader (TestFailure $defect, $count)
 
 printDefectTrace (TestFailure $defect)
 
 printErrors (TestResult $result)
 
 printFailures (TestResult $result)
 
 printWarnings (TestResult $result)
 
 printIncompletes (TestResult $result)
 
 printRisky (TestResult $result)
 
 printSkipped (TestResult $result)
 
 printHeader ()
 
 printFooter (TestResult $result)
 
 writeProgress ($progress)
 
 writeNewLine ()
 
 formatWithColor ($color, $buffer)
 
 writeWithColor ($color, $buffer, $lf=true)
 
 writeProgressWithColor ($color, $buffer)
 

Protected Attributes

 $column = 0
 
 $maxColumn
 
 $lastTestFailed = false
 
 $numAssertions = 0
 
 $numTests = -1
 
 $numTestsRun = 0
 
 $numTestsWidth
 
 $colors = false
 
 $debug = false
 
 $verbose = false
 
- Protected Attributes inherited from PHPUnit\Util\Printer
 $autoFlush = false
 
 $out
 
 $outTarget
 

Detailed Description

Prints the result of a TextUI TestRunner run.

Constructor & Destructor Documentation

◆ __construct()

PHPUnit\TextUI\ResultPrinter::__construct (   $out = null,
  $verbose = false,
  $colors = self::COLOR_DEFAULT,
  $debug = false,
  $numberOfColumns = 80,
  $reverse = false 
)

Constructor.

Parameters
mixed$out
bool$verbose
string$colors
bool$debug
int | string$numberOfColumns
bool$reverse
Exceptions
Exception

Member Function Documentation

◆ addError()

PHPUnit\TextUI\ResultPrinter::addError ( Test  $test,
\Exception  $e,
  $time 
)

An error occurred.

Parameters
Test$test
\Exception$e
float$time

Implements PHPUnit\Framework\TestListener.

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ addFailure()

PHPUnit\TextUI\ResultPrinter::addFailure ( Test  $test,
AssertionFailedError  $e,
  $time 
)

A failure occurred.

Parameters
Test$test
AssertionFailedError$e
float$time

Implements PHPUnit\Framework\TestListener.

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ addIncompleteTest()

PHPUnit\TextUI\ResultPrinter::addIncompleteTest ( Test  $test,
\Exception  $e,
  $time 
)

Incomplete test.

Parameters
Test$test
\Exception$e
float$time

Implements PHPUnit\Framework\TestListener.

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ addRiskyTest()

PHPUnit\TextUI\ResultPrinter::addRiskyTest ( Test  $test,
\Exception  $e,
  $time 
)

Risky test.

Parameters
Test$test
\Exception$e
float$time

Implements PHPUnit\Framework\TestListener.

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ addSkippedTest()

PHPUnit\TextUI\ResultPrinter::addSkippedTest ( Test  $test,
\Exception  $e,
  $time 
)

Skipped test.

Parameters
Test$test
\Exception$e
float$time

Implements PHPUnit\Framework\TestListener.

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ addWarning()

PHPUnit\TextUI\ResultPrinter::addWarning ( Test  $test,
Warning  $e,
  $time 
)

A warning occurred.

Parameters
Test$test
Warning$e
float$time

Implements PHPUnit\Framework\TestListener.

◆ endTest()

PHPUnit\TextUI\ResultPrinter::endTest ( Test  $test,
  $time 
)

A test ended.

Parameters
Test$test
float$time

Implements PHPUnit\Framework\TestListener.

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ endTestSuite()

PHPUnit\TextUI\ResultPrinter::endTestSuite ( TestSuite  $suite)

A testsuite ended.

Parameters
TestSuite$suite

Implements PHPUnit\Framework\TestListener.

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ formatWithColor()

PHPUnit\TextUI\ResultPrinter::formatWithColor (   $color,
  $buffer 
)
protected

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

Parameters
string$color
string$buffer
Returns
string

◆ printDefect()

PHPUnit\TextUI\ResultPrinter::printDefect ( TestFailure  $defect,
  $count 
)
protected
Parameters
TestFailure$defect
int$count

◆ printDefectHeader()

PHPUnit\TextUI\ResultPrinter::printDefectHeader ( TestFailure  $defect,
  $count 
)
protected
Parameters
TestFailure$defect
int$count

◆ printDefects()

PHPUnit\TextUI\ResultPrinter::printDefects ( array  $defects,
  $type 
)
protected
Parameters
array$defects
string$type

◆ printDefectTrace()

PHPUnit\TextUI\ResultPrinter::printDefectTrace ( TestFailure  $defect)
protected
Parameters
TestFailure$defect

◆ printErrors()

PHPUnit\TextUI\ResultPrinter::printErrors ( TestResult  $result)
protected
Parameters
TestResult$result

◆ printFailures()

PHPUnit\TextUI\ResultPrinter::printFailures ( TestResult  $result)
protected
Parameters
TestResult$result

◆ printFooter()

PHPUnit\TextUI\ResultPrinter::printFooter ( TestResult  $result)
protected
Parameters
TestResult$result

◆ printIncompletes()

PHPUnit\TextUI\ResultPrinter::printIncompletes ( TestResult  $result)
protected
Parameters
TestResult$result

◆ printResult()

PHPUnit\TextUI\ResultPrinter::printResult ( TestResult  $result)
Parameters
TestResult$result

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ printRisky()

PHPUnit\TextUI\ResultPrinter::printRisky ( TestResult  $result)
protected
Parameters
TestResult$result

◆ printSkipped()

PHPUnit\TextUI\ResultPrinter::printSkipped ( TestResult  $result)
protected
Parameters
TestResult$result

◆ printWarnings()

PHPUnit\TextUI\ResultPrinter::printWarnings ( TestResult  $result)
protected
Parameters
TestResult$result

◆ startTest()

PHPUnit\TextUI\ResultPrinter::startTest ( Test  $test)

A test started.

Parameters
Test$test

Implements PHPUnit\Framework\TestListener.

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ startTestSuite()

PHPUnit\TextUI\ResultPrinter::startTestSuite ( TestSuite  $suite)

A testsuite started.

Parameters
TestSuite$suite

Implements PHPUnit\Framework\TestListener.

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ writeProgress()

PHPUnit\TextUI\ResultPrinter::writeProgress (   $progress)
protected
Parameters
string$progress

Reimplemented in PHPUnit\Util\Log\TeamCity.

◆ writeProgressWithColor()

PHPUnit\TextUI\ResultPrinter::writeProgressWithColor (   $color,
  $buffer 
)
protected

Writes progress with a color sequence if colors are enabled.

Parameters
string$color
string$buffer

◆ writeWithColor()

PHPUnit\TextUI\ResultPrinter::writeWithColor (   $color,
  $buffer,
  $lf = true 
)
protected

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

Parameters
string$color
string$buffer
bool$lf

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