PHPUnit_Framework_TestResult
class PHPUnit_Framework_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 PHPUnit_Framework_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 an error to the list of errors.
Adds a warning to the list of warnings.
Adds a failure to the list of failures.
Informs the result that a testsuite will be started.
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 180
addListener(PHPUnit_Framework_TestListener $listener)
Registers a TestListener.
at line 190
removeListener(PHPUnit_Framework_TestListener $listener)
Unregisters a TestListener.
at line 202
flushListeners()
Flushes all flushable TestListeners.
at line 218
addError(PHPUnit_Framework_Test $test, Throwable $t, float $time)
Adds an error to the list of errors.
at line 275
addWarning(PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, float $time)
Adds a warning to the list of warnings.
The passed in exception caused the warning.
at line 302
addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time)
Adds a failure to the list of failures.
The passed in exception caused the failure.
at line 352
startTestSuite(PHPUnit_Framework_TestSuite $suite)
Informs the result that a testsuite will be started.
at line 368
endTestSuite(PHPUnit_Framework_TestSuite $suite)
Informs the result that a testsuite was completed.
at line 380
startTest(PHPUnit_Framework_Test $test)
Informs the result that a test will be started.
at line 396
endTest(PHPUnit_Framework_Test $test, float $time)
Informs the result that a test was completed.
at line 423
bool
allHarmless()
Returns true if no risky test occurred.
at line 433
int
riskyCount()
Gets the number of risky tests.
at line 443
bool
allCompletelyImplemented()
Returns true if no incomplete test occurred.
at line 453
int
notImplementedCount()
Gets the number of incomplete tests.
at line 463
array
risky()
Returns an Enumeration for the risky tests.
at line 473
array
notImplemented()
Returns an Enumeration for the incomplete tests.
at line 483
bool
noneSkipped()
Returns true if no test has been skipped.
at line 493
int
skippedCount()
Gets the number of skipped tests.
at line 503
array
skipped()
Returns an Enumeration for the skipped tests.
at line 513
int
errorCount()
Gets the number of detected errors.
at line 523
array
errors()
Returns an Enumeration for the errors.
at line 533
int
failureCount()
Gets the number of detected failures.
at line 543
array
failures()
Returns an Enumeration for the failures.
at line 553
int
warningCount()
Gets the number of detected warnings.
at line 563
array
warnings()
Returns an Enumeration for the warnings.
at line 573
array
passed()
Returns the names of the tests that have passed.
at line 583
PHPUnit_Framework_TestSuite
topTestSuite()
Returns the (top) test suite.
at line 593
bool
getCollectCodeCoverageInformation()
Returns whether code coverage information should be collected.
at line 603
run(PHPUnit_Framework_Test $test)
Runs a TestCase.
at line 897
int
count()
Gets the number of run tests.
at line 907
bool
shouldStop()
Checks whether the test run should stop.
at line 915
stop()
Marks that the test run should stop.
at line 925
CodeCoverage
getCodeCoverage()
Returns the code coverage object.
at line 935
setCodeCoverage(CodeCoverage $codeCoverage)
Sets the code coverage object.
at line 947
convertErrorsToExceptions(bool $flag)
Enables or disables the error-to-exception conversion.
at line 961
bool
getConvertErrorsToExceptions()
Returns the error-to-exception conversion setting.
at line 973
stopOnError(bool $flag)
Enables or disables the stopping when an error occurs.
at line 989
stopOnFailure(bool $flag)
Enables or disables the stopping when a failure occurs.
at line 1005
stopOnWarning(bool $flag)
Enables or disables the stopping when a warning occurs.
at line 1019
beStrictAboutTestsThatDoNotTestAnything(bool $flag)
at line 1031
bool
isStrictAboutTestsThatDoNotTestAnything()
at line 1041
beStrictAboutOutputDuringTests(bool $flag)
at line 1053
bool
isStrictAboutOutputDuringTests()
at line 1063
beStrictAboutResourceUsageDuringSmallTests(bool $flag)
at line 1075
bool
isStrictAboutResourceUsageDuringSmallTests()
at line 1085
enforceTimeLimit(bool $flag)
at line 1097
bool
enforcesTimeLimit()
at line 1107
beStrictAboutTodoAnnotatedTests(bool $flag)
at line 1119
bool
isStrictAboutTodoAnnotatedTests()
at line 1131
stopOnRisky(bool $flag)
Enables or disables the stopping for risky tests.
at line 1147
stopOnIncomplete(bool $flag)
Enables or disables the stopping for incomplete tests.
at line 1163
stopOnSkipped(bool $flag)
Enables or disables the stopping for skipped tests.
at line 1177
float
time()
Returns the time spent running the tests.
at line 1189
bool
wasSuccessful(bool $includeWarnings = true)
Returns whether the entire test was successful or not.
at line 1205
setTimeoutForSmallTests(int $timeout)
Sets the timeout for small tests.
at line 1221
setTimeoutForMediumTests(int $timeout)
Sets the timeout for medium tests.
at line 1237
setTimeoutForLargeTests(int $timeout)
Sets the timeout for large tests.
at line 1251
int
getTimeoutForLargeTests()
Returns the set timeout for large tests.
at line 1259
setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag)
at line 1276
protected array
getHierarchy(string $className, bool $asReflectionObjects = false)
Returns the class hierarchy for a given class.