class PHPUnit_Util_Log_TeamCity extends PHPUnit_TextUI_ResultPrinter (View source)

A TestListener that generates a logfile of the test execution using the TeamCity format (for use with PhpStorm, for instance).

Constants

EVENT_TEST_START

EVENT_TEST_END

EVENT_TESTSUITE_START

EVENT_TESTSUITE_END

COLOR_NEVER

COLOR_AUTO

COLOR_ALWAYS

COLOR_DEFAULT

Properties

protected bool $autoFlush If true, flush output after every write. from PHPUnit_Util_Printer
protected resource $out from PHPUnit_Util_Printer
protected string $outTarget from PHPUnit_Util_Printer
protected int $column from PHPUnit_TextUI_ResultPrinter
protected int $maxColumn from PHPUnit_TextUI_ResultPrinter
protected bool $lastTestFailed from PHPUnit_TextUI_ResultPrinter
protected int $numAssertions from PHPUnit_TextUI_ResultPrinter
protected int $numTests from PHPUnit_TextUI_ResultPrinter
protected int $numTestsRun from PHPUnit_TextUI_ResultPrinter
protected int $numTestsWidth from PHPUnit_TextUI_ResultPrinter
protected bool $colors from PHPUnit_TextUI_ResultPrinter
protected bool $debug from PHPUnit_TextUI_ResultPrinter
protected bool $verbose from PHPUnit_TextUI_ResultPrinter

Methods

__construct(mixed $out = null, bool $verbose = false, string $colors = self::COLOR_DEFAULT, bool $debug = false, int|string $numberOfColumns = 80, bool $reverse = false)

Constructor.

flush()

Flush buffer and close output if it's not to a PHP stream

incrementalFlush()

Performs a safe, incremental flush.

write(string $buffer)

No description

bool
getAutoFlush()

Check auto-flush mode.

setAutoFlush(bool $autoFlush)

Set auto-flushing mode.

printResult(PHPUnit_Framework_TestResult $result)

No description

printDefects(array $defects, string $type)

No description

printDefect(PHPUnit_Framework_TestFailure $defect, int $count)

No description

printHeader()

No description

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.

addWarning(PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, float $time)

A warning 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.

startTestSuite(PHPUnit_Framework_TestSuite $suite)

A testsuite started.

endTestSuite(PHPUnit_Framework_TestSuite $suite)

A testsuite ended.

startTest(PHPUnit_Framework_Test $test)

A test started.

endTest(PHPUnit_Framework_Test $test, float $time)

A test ended.

writeProgress(string $progress)

No description

string
formatWithColor(string $color, string $buffer)

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

writeWithColor(string $color, string $buffer, bool $lf = true)

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

writeProgressWithColor(string $color, string $buffer)

Writes progress with a color sequence if colors are enabled.

printIgnoredTest($testName, Exception $e)

No description

Details

__construct(mixed $out = null, bool $verbose = false, string $colors = self::COLOR_DEFAULT, bool $debug = false, int|string $numberOfColumns = 80, bool $reverse = false)

Constructor.

Parameters

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

Exceptions

PHPUnit_Framework_Exception

flush()

Flush buffer and close output if it's not to a PHP stream

incrementalFlush()

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.

write(string $buffer)

Parameters

string $buffer

bool getAutoFlush()

Check auto-flush mode.

Return Value

bool

setAutoFlush(bool $autoFlush)

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.

Parameters

bool $autoFlush

printResult(PHPUnit_Framework_TestResult $result)

Parameters

PHPUnit_Framework_TestResult $result

protected printDefects(array $defects, string $type)

Parameters

array $defects
string $type

protected printDefect(PHPUnit_Framework_TestFailure $defect, int $count)

Parameters

PHPUnit_Framework_TestFailure $defect
int $count

protected printDefectHeader(PHPUnit_Framework_TestFailure $defect, int $count)

Parameters

PHPUnit_Framework_TestFailure $defect
int $count

protected printDefectTrace(PHPUnit_Framework_TestFailure $defect)

Parameters

PHPUnit_Framework_TestFailure $defect

protected printFailures(PHPUnit_Framework_TestResult $result)

Parameters

PHPUnit_Framework_TestResult $result

protected printWarnings(PHPUnit_Framework_TestResult $result)

Parameters

PHPUnit_Framework_TestResult $result

protected printIncompletes(PHPUnit_Framework_TestResult $result)

Parameters

PHPUnit_Framework_TestResult $result

protected printSkipped(PHPUnit_Framework_TestResult $result)

Parameters

PHPUnit_Framework_TestResult $result

protected printHeader()

printWaitPrompt()

addError(PHPUnit_Framework_Test $test, Exception $e, float $time)

An error occurred.

Parameters

PHPUnit_Framework_Test $test
Exception $e
float $time

addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time)

A failure occurred.

addWarning(PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, float $time)

A warning occurred.

Parameters

PHPUnit_Framework_Test $test
PHPUnit_Framework_Warning $e
float $time

addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, float $time)

Incomplete test.

Parameters

PHPUnit_Framework_Test $test
Exception $e
float $time

addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, float $time)

Risky test.

Parameters

PHPUnit_Framework_Test $test
Exception $e
float $time

addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, float $time)

Skipped test.

Parameters

PHPUnit_Framework_Test $test
Exception $e
float $time

startTestSuite(PHPUnit_Framework_TestSuite $suite)

A testsuite started.

Parameters

PHPUnit_Framework_TestSuite $suite

endTestSuite(PHPUnit_Framework_TestSuite $suite)

A testsuite ended.

Parameters

PHPUnit_Framework_TestSuite $suite

startTest(PHPUnit_Framework_Test $test)

A test started.

Parameters

PHPUnit_Framework_Test $test

endTest(PHPUnit_Framework_Test $test, float $time)

A test ended.

Parameters

PHPUnit_Framework_Test $test
float $time

protected writeProgress(string $progress)

Parameters

string $progress

protected writeNewLine()

protected string formatWithColor(string $color, string $buffer)

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

Parameters

string $color
string $buffer

Return Value

string

protected writeWithColor(string $color, string $buffer, bool $lf = true)

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

Parameters

string $color
string $buffer
bool $lf

protected writeProgressWithColor(string $color, string $buffer)

Writes progress with a color sequence if colors are enabled.

Parameters

string $color
string $buffer

printIgnoredTest($testName, Exception $e)

Parameters

$testName
Exception $e