TestResult
class TestResult implements Countable (View source)
A TestResult collects the results of executing a test case.
Properties
protected array | $passed | ||
protected array | $errors | ||
protected array | $failures | ||
protected array | $warnings | ||
protected array | $notImplemented | ||
protected array | $risky | ||
protected array | $skipped | ||
protected array | $listeners | ||
protected int | $runTests | ||
protected float | $time | ||
protected TestSuite | $topTestSuite | ||
protected CodeCoverage | $codeCoverage | Code Coverage information. | |
protected bool | $convertErrorsToExceptions | ||
protected bool | $stop | ||
protected bool | $stopOnError | ||
protected bool | $stopOnFailure | ||
protected bool | $stopOnWarning | ||
protected bool | $beStrictAboutTestsThatDoNotTestAnything | ||
protected bool | $beStrictAboutOutputDuringTests | ||
protected bool | $beStrictAboutTodoAnnotatedTests | ||
protected bool | $beStrictAboutResourceUsageDuringSmallTests | ||
protected bool | $enforceTimeLimit | ||
protected int | $timeoutForSmallTests | ||
protected int | $timeoutForMediumTests | ||
protected int | $timeoutForLargeTests | ||
protected bool | $stopOnRisky | ||
protected bool | $stopOnIncomplete | ||
protected bool | $stopOnSkipped | ||
protected bool | $lastTestFailed |
Methods
Flushes all flushable TestListeners.
Adds a failure to the list of failures.
Returns true if no risky test occurred.
Gets the number of risky tests.
Returns true if no incomplete test occurred.
Gets the number of incomplete tests.
Returns an Enumeration for the risky tests.
Returns an Enumeration for the incomplete tests.
Returns true if no test has been skipped.
Gets the number of skipped tests.
Returns an Enumeration for the skipped tests.
Gets the number of detected errors.
Returns an Enumeration for the errors.
Gets the number of detected failures.
Returns an Enumeration for the failures.
Gets the number of detected warnings.
Returns an Enumeration for the warnings.
Returns the names of the tests that have passed.
Returns the (top) test suite.
Returns whether code coverage information should be collected.
Gets the number of run tests.
Checks whether the test run should stop.
Marks that the test run should stop.
Returns the code coverage object.
Sets the code coverage object.
Enables or disables the error-to-exception conversion.
Returns the error-to-exception conversion setting.
Enables or disables the stopping when an error occurs.
Enables or disables the stopping when a failure occurs.
Enables or disables the stopping when a warning occurs.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Enables or disables the stopping for risky tests.
Enables or disables the stopping for incomplete tests.
Enables or disables the stopping for skipped tests.
Returns the time spent running the tests.
Returns whether the entire test was successful or not.
Sets the timeout for small tests.
Sets the timeout for medium tests.
Sets the timeout for large tests.
Returns the set timeout for large tests.
No description
Returns the class hierarchy for a given class.
Details
at line 194
addListener(TestListener $listener)
Registers a TestListener.
at line 204
removeListener(TestListener $listener)
Unregisters a TestListener.
at line 216
flushListeners()
Flushes all flushable TestListeners.
at line 289
addWarning(Test $test, Warning $e, float $time)
Adds a warning to the list of warnings.
The passed in exception caused the warning.
at line 312
addFailure(Test $test, AssertionFailedError $e, float $time)
Adds a failure to the list of failures.
The passed in exception caused the failure.
at line 432
bool
allHarmless()
Returns true if no risky test occurred.
at line 442
int
riskyCount()
Gets the number of risky tests.
at line 452
bool
allCompletelyImplemented()
Returns true if no incomplete test occurred.
at line 462
int
notImplementedCount()
Gets the number of incomplete tests.
at line 472
array
risky()
Returns an Enumeration for the risky tests.
at line 482
array
notImplemented()
Returns an Enumeration for the incomplete tests.
at line 492
bool
noneSkipped()
Returns true if no test has been skipped.
at line 502
int
skippedCount()
Gets the number of skipped tests.
at line 512
array
skipped()
Returns an Enumeration for the skipped tests.
at line 522
int
errorCount()
Gets the number of detected errors.
at line 532
array
errors()
Returns an Enumeration for the errors.
at line 542
int
failureCount()
Gets the number of detected failures.
at line 552
array
failures()
Returns an Enumeration for the failures.
at line 562
int
warningCount()
Gets the number of detected warnings.
at line 572
array
warnings()
Returns an Enumeration for the warnings.
at line 582
array
passed()
Returns the names of the tests that have passed.
at line 602
bool
getCollectCodeCoverageInformation()
Returns whether code coverage information should be collected.
at line 900
int
count()
Gets the number of run tests.
at line 910
bool
shouldStop()
Checks whether the test run should stop.
at line 918
stop()
Marks that the test run should stop.
at line 928
CodeCoverage
getCodeCoverage()
Returns the code coverage object.
at line 938
setCodeCoverage(CodeCoverage $codeCoverage)
Sets the code coverage object.
at line 950
convertErrorsToExceptions(bool $flag)
Enables or disables the error-to-exception conversion.
at line 964
bool
getConvertErrorsToExceptions()
Returns the error-to-exception conversion setting.
at line 976
stopOnError(bool $flag)
Enables or disables the stopping when an error occurs.
at line 992
stopOnFailure(bool $flag)
Enables or disables the stopping when a failure occurs.
at line 1008
stopOnWarning(bool $flag)
Enables or disables the stopping when a warning occurs.
at line 1022
beStrictAboutTestsThatDoNotTestAnything(bool $flag)
at line 1034
bool
isStrictAboutTestsThatDoNotTestAnything()
at line 1044
beStrictAboutOutputDuringTests(bool $flag)
at line 1056
bool
isStrictAboutOutputDuringTests()
at line 1066
beStrictAboutResourceUsageDuringSmallTests(bool $flag)
at line 1078
bool
isStrictAboutResourceUsageDuringSmallTests()
at line 1088
enforceTimeLimit(bool $flag)
at line 1100
bool
enforcesTimeLimit()
at line 1110
beStrictAboutTodoAnnotatedTests(bool $flag)
at line 1122
bool
isStrictAboutTodoAnnotatedTests()
at line 1134
stopOnRisky(bool $flag)
Enables or disables the stopping for risky tests.
at line 1150
stopOnIncomplete(bool $flag)
Enables or disables the stopping for incomplete tests.
at line 1166
stopOnSkipped(bool $flag)
Enables or disables the stopping for skipped tests.
at line 1180
float
time()
Returns the time spent running the tests.
at line 1190
bool
wasSuccessful()
Returns whether the entire test was successful or not.
at line 1202
setTimeoutForSmallTests(int $timeout)
Sets the timeout for small tests.
at line 1218
setTimeoutForMediumTests(int $timeout)
Sets the timeout for medium tests.
at line 1234
setTimeoutForLargeTests(int $timeout)
Sets the timeout for large tests.
at line 1248
int
getTimeoutForLargeTests()
Returns the set timeout for large tests.
at line 1256
setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag)
at line 1273
protected array
getHierarchy(string $className, bool $asReflectionObjects = false)
Returns the class hierarchy for a given class.