Documentation

PHPUnit_Framework_TestResult
in package
implements Countable

A TestResult collects the results of executing a test case.

Tags
since

Class available since Release 2.0.0

Interfaces, Classes and Traits

Countable

Table of Contents

$beStrictAboutOutputDuringTests  : bool
$beStrictAboutTestSize  : bool
$beStrictAboutTestsThatDoNotTestAnything  : bool
$beStrictAboutTodoAnnotatedTests  : bool
$codeCoverage  : PHP_CodeCoverage
Code Coverage information.
$convertErrorsToExceptions  : bool
$errors  : array<string|int, mixed>
$failures  : array<string|int, mixed>
$lastTestFailed  : bool
$listeners  : array<string|int, mixed>
$notImplemented  : array<string|int, mixed>
$passed  : array<string|int, mixed>
$risky  : array<string|int, mixed>
$runTests  : int
$skipped  : array<string|int, mixed>
$stop  : bool
$stopOnError  : bool
$stopOnFailure  : bool
$stopOnIncomplete  : bool
$stopOnRisky  : bool
$stopOnSkipped  : bool
$time  : float
$timeoutForLargeTests  : int
$timeoutForMediumTests  : int
$timeoutForSmallTests  : int
$topTestSuite  : PHPUnit_Framework_TestSuite
addError()  : mixed
Adds an error to the list of errors.
addFailure()  : mixed
Adds a failure to the list of failures.
addListener()  : mixed
Registers a TestListener.
allCompletelyImplemented()  : bool
Returns true if no incomplete test occurred.
allHarmless()  : bool
Returns true if no risky test occurred.
beStrictAboutOutputDuringTests()  : mixed
beStrictAboutTestSize()  : mixed
beStrictAboutTestsThatDoNotTestAnything()  : mixed
beStrictAboutTodoAnnotatedTests()  : mixed
convertErrorsToExceptions()  : mixed
Enables or disables the error-to-exception conversion.
count()  : int
Gets the number of run tests.
endTest()  : mixed
Informs the result that a test was completed.
endTestSuite()  : mixed
Informs the result that a testsuite was completed.
errorCount()  : int
Gets the number of detected errors.
errors()  : array<string|int, mixed>
Returns an Enumeration for the errors.
failureCount()  : int
Gets the number of detected failures.
failures()  : array<string|int, mixed>
Returns an Enumeration for the failures.
flushListeners()  : mixed
Flushes all flushable TestListeners.
getCodeCoverage()  : PHP_CodeCoverage
Returns the PHP_CodeCoverage object.
getCollectCodeCoverageInformation()  : bool
Returns whether code coverage information should be collected.
getConvertErrorsToExceptions()  : bool
Returns the error-to-exception conversion setting.
isStrictAboutOutputDuringTests()  : bool
isStrictAboutTestSize()  : bool
isStrictAboutTestsThatDoNotTestAnything()  : bool
isStrictAboutTodoAnnotatedTests()  : bool
noneSkipped()  : bool
Returns true if no test has been skipped.
notImplemented()  : array<string|int, mixed>
Returns an Enumeration for the incomplete tests.
notImplementedCount()  : int
Gets the number of incomplete tests.
passed()  : array<string|int, mixed>
Returns the names of the tests that have passed.
removeListener()  : mixed
Unregisters a TestListener.
risky()  : array<string|int, mixed>
Returns an Enumeration for the risky tests.
riskyCount()  : int
Gets the number of risky tests.
run()  : mixed
Runs a TestCase.
setCodeCoverage()  : mixed
Sets the PHP_CodeCoverage object.
setTimeoutForLargeTests()  : mixed
Sets the timeout for large tests.
setTimeoutForMediumTests()  : mixed
Sets the timeout for medium tests.
setTimeoutForSmallTests()  : mixed
Sets the timeout for small tests.
shouldStop()  : bool
Checks whether the test run should stop.
skipped()  : array<string|int, mixed>
Returns an Enumeration for the skipped tests.
skippedCount()  : int
Gets the number of skipped tests.
startTest()  : mixed
Informs the result that a test will be started.
startTestSuite()  : mixed
Informs the result that a testsuite will be started.
stop()  : mixed
Marks that the test run should stop.
stopOnError()  : mixed
Enables or disables the stopping when an error occurs.
stopOnFailure()  : mixed
Enables or disables the stopping when a failure occurs.
stopOnIncomplete()  : mixed
Enables or disables the stopping for incomplete tests.
stopOnRisky()  : mixed
Enables or disables the stopping for risky tests.
stopOnSkipped()  : mixed
Enables or disables the stopping for skipped tests.
time()  : float
Returns the time spent running the tests.
topTestSuite()  : PHPUnit_Framework_TestSuite
Returns the (top) test suite.
wasSuccessful()  : bool
Returns whether the entire test was successful or not.
getHierarchy()  : array<string|int, mixed>
Returns the class hierarchy for a given class.

Properties

$beStrictAboutOutputDuringTests

protected bool $beStrictAboutOutputDuringTests = alse

$beStrictAboutTestSize

protected bool $beStrictAboutTestSize = alse

$beStrictAboutTestsThatDoNotTestAnything

protected bool $beStrictAboutTestsThatDoNotTestAnything = alse

$beStrictAboutTodoAnnotatedTests

protected bool $beStrictAboutTodoAnnotatedTests = alse

$convertErrorsToExceptions

protected bool $convertErrorsToExceptions = rue

$errors

protected array<string|int, mixed> $errors = array()

$failures

protected array<string|int, mixed> $failures = array()

$lastTestFailed

protected bool $lastTestFailed = alse

$listeners

protected array<string|int, mixed> $listeners = array()

$notImplemented

protected array<string|int, mixed> $notImplemented = array()

$passed

protected array<string|int, mixed> $passed = array()

$risky

protected array<string|int, mixed> $risky = array()

$skipped

protected array<string|int, mixed> $skipped = array()

$stopOnFailure

protected bool $stopOnFailure = alse

$stopOnIncomplete

protected bool $stopOnIncomplete = alse

$stopOnRisky

protected bool $stopOnRisky = alse

$stopOnSkipped

protected bool $stopOnSkipped = alse

$timeoutForLargeTests

protected int $timeoutForLargeTests = 60

$timeoutForMediumTests

protected int $timeoutForMediumTests = 10

$timeoutForSmallTests

protected int $timeoutForSmallTests = 1

Methods

allCompletelyImplemented()

Returns true if no incomplete test occurred.

public allCompletelyImplemented() : bool
Return values
bool

allHarmless()

Returns true if no risky test occurred.

public allHarmless() : bool
Tags
since

Method available since Release 4.0.0

Return values
bool

beStrictAboutOutputDuringTests()

public beStrictAboutOutputDuringTests(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 4.0.0

Return values
mixed

beStrictAboutTestSize()

public beStrictAboutTestSize(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 4.0.0

Return values
mixed

beStrictAboutTestsThatDoNotTestAnything()

public beStrictAboutTestsThatDoNotTestAnything(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 4.0.0

Return values
mixed

beStrictAboutTodoAnnotatedTests()

public beStrictAboutTodoAnnotatedTests(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 4.2.0

Return values
mixed

convertErrorsToExceptions()

Enables or disables the error-to-exception conversion.

public convertErrorsToExceptions(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.2.14

Return values
mixed

count()

Gets the number of run tests.

public count() : int
Return values
int

errorCount()

Gets the number of detected errors.

public errorCount() : int
Return values
int

errors()

Returns an Enumeration for the errors.

public errors() : array<string|int, mixed>
Return values
array<string|int, mixed>

failureCount()

Gets the number of detected failures.

public failureCount() : int
Return values
int

failures()

Returns an Enumeration for the failures.

public failures() : array<string|int, mixed>
Return values
array<string|int, mixed>

flushListeners()

Flushes all flushable TestListeners.

public flushListeners() : mixed
Tags
since

Method available since Release 3.0.0

Return values
mixed

getCollectCodeCoverageInformation()

Returns whether code coverage information should be collected.

public getCollectCodeCoverageInformation() : bool
Tags
since

Method available since Release 3.2.0

Return values
bool

If code coverage should be collected

getConvertErrorsToExceptions()

Returns the error-to-exception conversion setting.

public getConvertErrorsToExceptions() : bool
Tags
since

Method available since Release 3.4.0

Return values
bool

isStrictAboutOutputDuringTests()

public isStrictAboutOutputDuringTests() : bool
Tags
since

Method available since Release 4.0.0

Return values
bool

isStrictAboutTestSize()

public isStrictAboutTestSize() : bool
Tags
since

Method available since Release 4.0.0

Return values
bool

isStrictAboutTestsThatDoNotTestAnything()

public isStrictAboutTestsThatDoNotTestAnything() : bool
Tags
since

Method available since Release 4.0.0

Return values
bool

isStrictAboutTodoAnnotatedTests()

public isStrictAboutTodoAnnotatedTests() : bool
Tags
since

Method available since Release 4.2.0

Return values
bool

noneSkipped()

Returns true if no test has been skipped.

public noneSkipped() : bool
Tags
since

Method available since Release 3.0.0

Return values
bool

notImplemented()

Returns an Enumeration for the incomplete tests.

public notImplemented() : array<string|int, mixed>
Return values
array<string|int, mixed>

notImplementedCount()

Gets the number of incomplete tests.

public notImplementedCount() : int
Return values
int

passed()

Returns the names of the tests that have passed.

public passed() : array<string|int, mixed>
Tags
since

Method available since Release 3.4.0

Return values
array<string|int, mixed>

risky()

Returns an Enumeration for the risky tests.

public risky() : array<string|int, mixed>
Tags
since

Method available since Release 4.0.0

Return values
array<string|int, mixed>

riskyCount()

Gets the number of risky tests.

public riskyCount() : int
Tags
since

Method available since Release 4.0.0

Return values
int

setCodeCoverage()

Sets the PHP_CodeCoverage object.

public setCodeCoverage(PHP_CodeCoverage $codeCoverage) : mixed
Parameters
$codeCoverage : PHP_CodeCoverage
Tags
since

Method available since Release 3.6.0

Return values
mixed

setTimeoutForLargeTests()

Sets the timeout for large tests.

public setTimeoutForLargeTests(int $timeout) : mixed
Parameters
$timeout : int
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.6.0

Return values
mixed

setTimeoutForMediumTests()

Sets the timeout for medium tests.

public setTimeoutForMediumTests(int $timeout) : mixed
Parameters
$timeout : int
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.6.0

Return values
mixed

setTimeoutForSmallTests()

Sets the timeout for small tests.

public setTimeoutForSmallTests(int $timeout) : mixed
Parameters
$timeout : int
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.6.0

Return values
mixed

shouldStop()

Checks whether the test run should stop.

public shouldStop() : bool
Return values
bool

skipped()

Returns an Enumeration for the skipped tests.

public skipped() : array<string|int, mixed>
Tags
since

Method available since Release 3.0.0

Return values
array<string|int, mixed>

skippedCount()

Gets the number of skipped tests.

public skippedCount() : int
Tags
since

Method available since Release 3.0.0

Return values
int

stop()

Marks that the test run should stop.

public stop() : mixed
Return values
mixed

stopOnError()

Enables or disables the stopping when an error occurs.

public stopOnError(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.5.0

Return values
mixed

stopOnFailure()

Enables or disables the stopping when a failure occurs.

public stopOnFailure(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.1.0

Return values
mixed

stopOnIncomplete()

Enables or disables the stopping for incomplete tests.

public stopOnIncomplete(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.5.0

Return values
mixed

stopOnRisky()

Enables or disables the stopping for risky tests.

public stopOnRisky(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 4.0.0

Return values
mixed

stopOnSkipped()

Enables or disables the stopping for skipped tests.

public stopOnSkipped(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.1.0

Return values
mixed

time()

Returns the time spent running the tests.

public time() : float
Return values
float

wasSuccessful()

Returns whether the entire test was successful or not.

public wasSuccessful() : bool
Return values
bool

getHierarchy()

Returns the class hierarchy for a given class.

protected getHierarchy(string $className[, bool $asReflectionObjects = false ]) : array<string|int, mixed>
Parameters
$className : string
$asReflectionObjects : bool = false
Return values
array<string|int, mixed>

Search results