PHPUnit_Framework_TestResult
in package
implements
Countable
A TestResult collects the results of executing a test case.
Tags
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
$codeCoverage
Code Coverage information.
protected
PHP_CodeCoverage
$codeCoverage
$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()
$runTests
protected
int
$runTests
= 0
$skipped
protected
array<string|int, mixed>
$skipped
= array()
$stop
protected
bool
$stop
= alse
$stopOnError
protected
bool
$stopOnError
= alse
$stopOnFailure
protected
bool
$stopOnFailure
= alse
$stopOnIncomplete
protected
bool
$stopOnIncomplete
= alse
$stopOnRisky
protected
bool
$stopOnRisky
= alse
$stopOnSkipped
protected
bool
$stopOnSkipped
= alse
$time
protected
float
$time
= 0
$timeoutForLargeTests
protected
int
$timeoutForLargeTests
= 60
$timeoutForMediumTests
protected
int
$timeoutForMediumTests
= 10
$timeoutForSmallTests
protected
int
$timeoutForSmallTests
= 1
$topTestSuite
protected
PHPUnit_Framework_TestSuite
$topTestSuite
=
ull
Methods
addError()
Adds an error to the list of errors.
public
addError(PHPUnit_Framework_Test $test, Exception $e, float $time) : mixed
Parameters
- $test : PHPUnit_Framework_Test
- $e : Exception
- $time : float
Return values
mixed —addFailure()
Adds a failure to the list of failures.
public
addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time) : mixed
The passed in exception caused the failure.
Parameters
- $test : PHPUnit_Framework_Test
- $e : PHPUnit_Framework_AssertionFailedError
- $time : float
Return values
mixed —addListener()
Registers a TestListener.
public
addListener(PHPUnit_Framework_TestListener $listener) : mixed
Parameters
- $listener : PHPUnit_Framework_TestListener
Return values
mixed —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
Return values
bool —beStrictAboutOutputDuringTests()
public
beStrictAboutOutputDuringTests(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —beStrictAboutTestSize()
public
beStrictAboutTestSize(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —beStrictAboutTestsThatDoNotTestAnything()
public
beStrictAboutTestsThatDoNotTestAnything(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —beStrictAboutTodoAnnotatedTests()
public
beStrictAboutTodoAnnotatedTests(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —convertErrorsToExceptions()
Enables or disables the error-to-exception conversion.
public
convertErrorsToExceptions(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —count()
Gets the number of run tests.
public
count() : int
Return values
int —endTest()
Informs the result that a test was completed.
public
endTest(PHPUnit_Framework_Test $test, float $time) : mixed
Parameters
- $test : PHPUnit_Framework_Test
- $time : float
Return values
mixed —endTestSuite()
Informs the result that a testsuite was completed.
public
endTestSuite(PHPUnit_Framework_TestSuite $suite) : mixed
Parameters
- $suite : PHPUnit_Framework_TestSuite
Tags
Return values
mixed —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
Return values
mixed —getCodeCoverage()
Returns the PHP_CodeCoverage object.
public
getCodeCoverage() : PHP_CodeCoverage
Tags
Return values
PHP_CodeCoverage —getCollectCodeCoverageInformation()
Returns whether code coverage information should be collected.
public
getCollectCodeCoverageInformation() : bool
Tags
Return values
bool —If code coverage should be collected
getConvertErrorsToExceptions()
Returns the error-to-exception conversion setting.
public
getConvertErrorsToExceptions() : bool
Tags
Return values
bool —isStrictAboutOutputDuringTests()
public
isStrictAboutOutputDuringTests() : bool
Tags
Return values
bool —isStrictAboutTestSize()
public
isStrictAboutTestSize() : bool
Tags
Return values
bool —isStrictAboutTestsThatDoNotTestAnything()
public
isStrictAboutTestsThatDoNotTestAnything() : bool
Tags
Return values
bool —isStrictAboutTodoAnnotatedTests()
public
isStrictAboutTodoAnnotatedTests() : bool
Tags
Return values
bool —noneSkipped()
Returns true if no test has been skipped.
public
noneSkipped() : bool
Tags
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
Return values
array<string|int, mixed> —removeListener()
Unregisters a TestListener.
public
removeListener(PHPUnit_Framework_TestListener $listener) : mixed
Parameters
- $listener : PHPUnit_Framework_TestListener
Return values
mixed —risky()
Returns an Enumeration for the risky tests.
public
risky() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —riskyCount()
Gets the number of risky tests.
public
riskyCount() : int
Tags
Return values
int —run()
Runs a TestCase.
public
run(PHPUnit_Framework_Test $test) : mixed
Parameters
- $test : PHPUnit_Framework_Test
Return values
mixed —setCodeCoverage()
Sets the PHP_CodeCoverage object.
public
setCodeCoverage(PHP_CodeCoverage $codeCoverage) : mixed
Parameters
- $codeCoverage : PHP_CodeCoverage
Tags
Return values
mixed —setTimeoutForLargeTests()
Sets the timeout for large tests.
public
setTimeoutForLargeTests(int $timeout) : mixed
Parameters
- $timeout : int
Tags
Return values
mixed —setTimeoutForMediumTests()
Sets the timeout for medium tests.
public
setTimeoutForMediumTests(int $timeout) : mixed
Parameters
- $timeout : int
Tags
Return values
mixed —setTimeoutForSmallTests()
Sets the timeout for small tests.
public
setTimeoutForSmallTests(int $timeout) : mixed
Parameters
- $timeout : int
Tags
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
Return values
array<string|int, mixed> —skippedCount()
Gets the number of skipped tests.
public
skippedCount() : int
Tags
Return values
int —startTest()
Informs the result that a test will be started.
public
startTest(PHPUnit_Framework_Test $test) : mixed
Parameters
- $test : PHPUnit_Framework_Test
Return values
mixed —startTestSuite()
Informs the result that a testsuite will be started.
public
startTestSuite(PHPUnit_Framework_TestSuite $suite) : mixed
Parameters
- $suite : PHPUnit_Framework_TestSuite
Tags
Return values
mixed —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
Return values
mixed —stopOnFailure()
Enables or disables the stopping when a failure occurs.
public
stopOnFailure(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —stopOnIncomplete()
Enables or disables the stopping for incomplete tests.
public
stopOnIncomplete(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —stopOnRisky()
Enables or disables the stopping for risky tests.
public
stopOnRisky(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —stopOnSkipped()
Enables or disables the stopping for skipped tests.
public
stopOnSkipped(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —time()
Returns the time spent running the tests.
public
time() : float
Return values
float —topTestSuite()
Returns the (top) test suite.
public
topTestSuite() : PHPUnit_Framework_TestSuite
Tags
Return values
PHPUnit_Framework_TestSuite —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