- \PHPUnit_Framework_TestResult
class (none) \ PHPUnit_Framework_TestResult
- All implemented interfaces:
- Countable
A TestResult collects the results of executing a test case.
Method Summary
Name | Description |
---|---|
addError(PHPUnit_Framework_Test $test, Exception $e, $time) | Adds an error to the list of errors. |
addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) | Adds a failure to the list of failures. The passed in exception caused the failure. |
addListener(PHPUnit_Framework_TestListener $listener) | Registers a TestListener. |
allCompletelyImplemented() | Returns true if no incomplete test occurred. |
allHarmless() | Returns true if no risky test occurred. |
beStrictAboutOutputDuringTests($flag) | |
beStrictAboutTestSize($flag) | |
beStrictAboutTestsThatDoNotTestAnything($flag) | |
beStrictAboutTodoAnnotatedTests($flag) | |
convertErrorsToExceptions($flag) | Enables or disables the error-to-exception conversion. |
count() | Gets the number of run tests. |
endTest(PHPUnit_Framework_Test $test, $time) | Informs the result that a test was completed. |
endTestSuite(PHPUnit_Framework_TestSuite $suite) | Informs the result that a testsuite was completed. |
errorCount() | Gets the number of detected errors. |
errors() | Returns an Enumeration for the errors. |
failureCount() | Gets the number of detected failures. |
failures() | Returns an Enumeration for the failures. |
flushListeners() | Flushes all flushable TestListeners. |
getCodeCoverage() | Returns the PHP_CodeCoverage object. |
getCollectCodeCoverageInformation() | Returns whether code coverage information should be collected. |
getConvertErrorsToExceptions() | Returns the error-to-exception conversion setting. |
getHierarchy($className, $asReflectionObjects = false) | Returns the class hierarchy for a given class. |
isStrictAboutOutputDuringTests() | |
isStrictAboutTestSize() | |
isStrictAboutTestsThatDoNotTestAnything() | |
isStrictAboutTodoAnnotatedTests() | |
noneSkipped() | Returns true if no test has been skipped. |
notImplemented() | Returns an Enumeration for the incomplete tests. |
notImplementedCount() | Gets the number of incomplete tests. |
passed() | Returns the names of the tests that have passed. |
removeListener(PHPUnit_Framework_TestListener $listener) | Unregisters a TestListener. |
risky() | Returns an Enumeration for the risky tests. |
riskyCount() | Gets the number of risky tests. |
run(PHPUnit_Framework_Test $test) | Runs a TestCase. |
setCodeCoverage(PHP_CodeCoverage $codeCoverage) | Sets the PHP_CodeCoverage object. |
setTimeoutForLargeTests($timeout) | Sets the timeout for large tests. |
setTimeoutForMediumTests($timeout) | Sets the timeout for medium tests. |
setTimeoutForSmallTests($timeout) | Sets the timeout for small tests. |
shouldStop() | Checks whether the test run should stop. |
skipped() | Returns an Enumeration for the skipped tests. |
skippedCount() | Gets the number of skipped tests. |
startTest(PHPUnit_Framework_Test $test) | Informs the result that a test will be started. |
startTestSuite(PHPUnit_Framework_TestSuite $suite) | Informs the result that a testsuite will be started. |
stop() | Marks that the test run should stop. |
stopOnError($flag) | Enables or disables the stopping when an error occurs. |
stopOnFailure($flag) | Enables or disables the stopping when a failure occurs. |
stopOnIncomplete($flag) | Enables or disables the stopping for incomplete tests. |
stopOnRisky($flag) | Enables or disables the stopping for risky tests. |
stopOnSkipped($flag) | Enables or disables the stopping for skipped tests. |
time() | Returns the time spent running the tests. |
topTestSuite() | Returns the (top) test suite. |
wasSuccessful() | Returns whether the entire test was successful or not. |
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time)
Adds an error to the list of errors.
- Parameters:
PHPUnit_Framework_Test
- $testException
- $efloat
- $time
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
Adds a failure to the list of failures. The passed in exception caused the failure.
- Parameters:
PHPUnit_Framework_Test
- $testPHPUnit_Framework_AssertionFailedError
- $efloat
- $time
public function addListener(PHPUnit_Framework_TestListener $listener)
Registers a TestListener.
- Parameters:
PHPUnit_Framework_TestListener
-
public function allCompletelyImplemented()
Returns true if no incomplete test occurred.
- Returns:
- boolean
public function allHarmless()
Returns true if no risky test occurred.
- Returns:
- boolean
public function beStrictAboutOutputDuringTests($flag)
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function beStrictAboutTestSize($flag)
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function beStrictAboutTestsThatDoNotTestAnything($flag)
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function beStrictAboutTodoAnnotatedTests($flag)
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function convertErrorsToExceptions($flag)
Enables or disables the error-to-exception conversion.
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function count()
Gets the number of run tests.
- Returns:
- integer
public function endTest(PHPUnit_Framework_Test $test, $time)
Informs the result that a test was completed.
- Parameters:
PHPUnit_Framework_Test
- $testfloat
- $time
public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
Informs the result that a testsuite was completed.
- Parameters:
PHPUnit_Framework_TestSuite
- $suite
public function errorCount()
Gets the number of detected errors.
- Returns:
- integer
public function errors()
Returns an Enumeration for the errors.
- Returns:
- array
public function failureCount()
Gets the number of detected failures.
- Returns:
- integer
public function failures()
Returns an Enumeration for the failures.
- Returns:
- array
public function flushListeners()
Flushes all flushable TestListeners.
public function getCodeCoverage()
Returns the PHP_CodeCoverage object.
- Returns:
- PHP_CodeCoverage
public function getCollectCodeCoverageInformation()
Returns whether code coverage information should be collected.
- Returns:
- boolean If code coverage should be collected
public function getConvertErrorsToExceptions()
Returns the error-to-exception conversion setting.
- Returns:
- boolean
protected function getHierarchy($className, $asReflectionObjects = false)
Returns the class hierarchy for a given class.
- Parameters:
string
- $classNameboolean
- $asReflectionObjects- Defaults:
asReflectionObjects
=false
- Returns:
- array
public function isStrictAboutOutputDuringTests()
- Returns:
- boolean
public function isStrictAboutTestSize()
- Returns:
- boolean
public function isStrictAboutTestsThatDoNotTestAnything()
- Returns:
- boolean
public function isStrictAboutTodoAnnotatedTests()
- Returns:
- boolean
public function noneSkipped()
Returns true if no test has been skipped.
- Returns:
- boolean
public function notImplemented()
Returns an Enumeration for the incomplete tests.
- Returns:
- array
public function notImplementedCount()
Gets the number of incomplete tests.
- Returns:
- integer
public function passed()
Returns the names of the tests that have passed.
- Returns:
- array
public function removeListener(PHPUnit_Framework_TestListener $listener)
Unregisters a TestListener.
- Parameters:
PHPUnit_Framework_TestListener
- $listener
public function risky()
Returns an Enumeration for the risky tests.
- Returns:
- array
public function riskyCount()
Gets the number of risky tests.
- Returns:
- integer
public function run(PHPUnit_Framework_Test $test)
Runs a TestCase.
- Parameters:
PHPUnit_Framework_Test
- $test
public function setCodeCoverage(PHP_CodeCoverage $codeCoverage)
Sets the PHP_CodeCoverage object.
- Parameters:
PHP_CodeCoverage
- $codeCoverage
public function setTimeoutForLargeTests($timeout)
Sets the timeout for large tests.
- Parameters:
integer
- $timeout- Throws:
- PHPUnit_Framework_Exception
public function setTimeoutForMediumTests($timeout)
Sets the timeout for medium tests.
- Parameters:
integer
- $timeout- Throws:
- PHPUnit_Framework_Exception
public function setTimeoutForSmallTests($timeout)
Sets the timeout for small tests.
- Parameters:
integer
- $timeout- Throws:
- PHPUnit_Framework_Exception
public function shouldStop()
Checks whether the test run should stop.
- Returns:
- boolean
public function skipped()
Returns an Enumeration for the skipped tests.
- Returns:
- array
public function skippedCount()
Gets the number of skipped tests.
- Returns:
- integer
public function startTest(PHPUnit_Framework_Test $test)
Informs the result that a test will be started.
- Parameters:
PHPUnit_Framework_Test
- $test
public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
Informs the result that a testsuite will be started.
- Parameters:
PHPUnit_Framework_TestSuite
- $suite
public function stop()
Marks that the test run should stop.
public function stopOnError($flag)
Enables or disables the stopping when an error occurs.
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function stopOnFailure($flag)
Enables or disables the stopping when a failure occurs.
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function stopOnIncomplete($flag)
Enables or disables the stopping for incomplete tests.
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function stopOnRisky($flag)
Enables or disables the stopping for risky tests.
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function stopOnSkipped($flag)
Enables or disables the stopping for skipped tests.
- Parameters:
boolean
- $flag- Throws:
- PHPUnit_Framework_Exception
public function time()
Returns the time spent running the tests.
- Returns:
- float
public function topTestSuite()
Returns the (top) test suite.
- Returns:
- PHPUnit_Framework_TestSuite
public function wasSuccessful()
Returns whether the entire test was successful or not.
- Returns:
- boolean