BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
PHPUnit_Framework_TestResult Class Reference
Inheritance diagram for PHPUnit_Framework_TestResult:
Collaboration diagram for PHPUnit_Framework_TestResult:

Public Member Functions

 addListener (PHPUnit_Framework_TestListener $listener)
 
 removeListener (PHPUnit_Framework_TestListener $listener)
 
 flushListeners ()
 
 addError (PHPUnit_Framework_Test $test, Exception $e, $time)
 
 addFailure (PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 
 startTestSuite (PHPUnit_Framework_TestSuite $suite)
 
 endTestSuite (PHPUnit_Framework_TestSuite $suite)
 
 startTest (PHPUnit_Framework_Test $test)
 
 endTest (PHPUnit_Framework_Test $test, $time)
 
 allHarmless ()
 
 riskyCount ()
 
 allCompletelyImplemented ()
 
 notImplementedCount ()
 
 risky ()
 
 notImplemented ()
 
 noneSkipped ()
 
 skippedCount ()
 
 skipped ()
 
 errorCount ()
 
 errors ()
 
 failureCount ()
 
 failures ()
 
 passed ()
 
 topTestSuite ()
 
 getCollectCodeCoverageInformation ()
 
 run (PHPUnit_Framework_Test $test)
 
 count ()
 
 shouldStop ()
 
 stop ()
 
 getCodeCoverage ()
 
 setCodeCoverage (PHP_CodeCoverage $codeCoverage)
 
 convertErrorsToExceptions ($flag)
 
 getConvertErrorsToExceptions ()
 
 stopOnError ($flag)
 
 stopOnFailure ($flag)
 
 beStrictAboutTestsThatDoNotTestAnything ($flag)
 
 isStrictAboutTestsThatDoNotTestAnything ()
 
 beStrictAboutOutputDuringTests ($flag)
 
 isStrictAboutOutputDuringTests ()
 
 beStrictAboutTestSize ($flag)
 
 isStrictAboutTestSize ()
 
 beStrictAboutTodoAnnotatedTests ($flag)
 
 isStrictAboutTodoAnnotatedTests ()
 
 stopOnRisky ($flag)
 
 stopOnIncomplete ($flag)
 
 stopOnSkipped ($flag)
 
 time ()
 
 wasSuccessful ()
 
 setTimeoutForSmallTests ($timeout)
 
 setTimeoutForMediumTests ($timeout)
 
 setTimeoutForLargeTests ($timeout)
 

Protected Member Functions

 getHierarchy ($className, $asReflectionObjects=false)
 

Protected Attributes

 $passed = array()
 
 $errors = array()
 
 $failures = array()
 
 $notImplemented = array()
 
 $risky = array()
 
 $skipped = array()
 
 $listeners = array()
 
 $runTests = 0
 
 $time = 0
 
 $topTestSuite = null
 
 $codeCoverage
 
 $convertErrorsToExceptions = true
 
 $stop = false
 
 $stopOnError = false
 
 $stopOnFailure = false
 
 $beStrictAboutTestsThatDoNotTestAnything = false
 
 $beStrictAboutOutputDuringTests = false
 
 $beStrictAboutTestSize = false
 
 $beStrictAboutTodoAnnotatedTests = false
 
 $stopOnRisky = false
 
 $stopOnIncomplete = false
 
 $stopOnSkipped = false
 
 $lastTestFailed = false
 
 $timeoutForSmallTests = 1
 
 $timeoutForMediumTests = 10
 
 $timeoutForLargeTests = 60
 

Detailed Description

A TestResult collects the results of executing a test case.

Since
Class available since Release 2.0.0

Member Function Documentation

PHPUnit_Framework_TestResult::addError ( PHPUnit_Framework_Test  $test,
Exception  $e,
  $time 
)

Adds an error to the list of errors.

Parameters
PHPUnit_Framework_Test$test
Exception$e
float$time
PHPUnit_Framework_TestResult::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$test
PHPUnit_Framework_AssertionFailedError$e
float$time
PHPUnit_Framework_TestResult::addListener ( PHPUnit_Framework_TestListener  $listener)

Registers a TestListener.

Parameters
PHPUnit_Framework_TestListener
PHPUnit_Framework_TestResult::allCompletelyImplemented ( )

Returns true if no incomplete test occurred.

Returns
bool
PHPUnit_Framework_TestResult::allHarmless ( )

Returns true if no risky test occurred.

Returns
bool
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::beStrictAboutOutputDuringTests (   $flag)
Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::beStrictAboutTestSize (   $flag)
Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::beStrictAboutTestsThatDoNotTestAnything (   $flag)
Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::beStrictAboutTodoAnnotatedTests (   $flag)
Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 4.2.0
PHPUnit_Framework_TestResult::convertErrorsToExceptions (   $flag)

Enables or disables the error-to-exception conversion.

Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 3.2.14
PHPUnit_Framework_TestResult::count ( )

Gets the number of run tests.

Returns
int

Implements Countable.

PHPUnit_Framework_TestResult::endTest ( PHPUnit_Framework_Test  $test,
  $time 
)

Informs the result that a test was completed.

Parameters
PHPUnit_Framework_Test$test
float$time
PHPUnit_Framework_TestResult::endTestSuite ( PHPUnit_Framework_TestSuite  $suite)

Informs the result that a testsuite was completed.

Parameters
PHPUnit_Framework_TestSuite$suite
Since
Method available since Release 2.2.0
PHPUnit_Framework_TestResult::errorCount ( )

Gets the number of detected errors.

Returns
int
PHPUnit_Framework_TestResult::errors ( )

Returns an Enumeration for the errors.

Returns
array
PHPUnit_Framework_TestResult::failureCount ( )

Gets the number of detected failures.

Returns
int
PHPUnit_Framework_TestResult::failures ( )

Returns an Enumeration for the failures.

Returns
array
PHPUnit_Framework_TestResult::flushListeners ( )

Flushes all flushable TestListeners.

Since
Method available since Release 3.0.0
PHPUnit_Framework_TestResult::getCodeCoverage ( )

Returns the PHP_CodeCoverage object.

Returns
PHP_CodeCoverage
Since
Method available since Release 3.5.0
PHPUnit_Framework_TestResult::getCollectCodeCoverageInformation ( )

Returns whether code coverage information should be collected.

Returns
bool If code coverage should be collected
Since
Method available since Release 3.2.0
PHPUnit_Framework_TestResult::getConvertErrorsToExceptions ( )

Returns the error-to-exception conversion setting.

Returns
bool
Since
Method available since Release 3.4.0
PHPUnit_Framework_TestResult::getHierarchy (   $className,
  $asReflectionObjects = false 
)
protected

Returns the class hierarchy for a given class.

Parameters
string$className
bool$asReflectionObjects
Returns
array
PHPUnit_Framework_TestResult::isStrictAboutOutputDuringTests ( )
Returns
bool
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::isStrictAboutTestSize ( )
Returns
bool
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::isStrictAboutTestsThatDoNotTestAnything ( )
Returns
bool
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::isStrictAboutTodoAnnotatedTests ( )
Returns
bool
Since
Method available since Release 4.2.0
PHPUnit_Framework_TestResult::noneSkipped ( )

Returns true if no test has been skipped.

Returns
bool
Since
Method available since Release 3.0.0
PHPUnit_Framework_TestResult::notImplemented ( )

Returns an Enumeration for the incomplete tests.

Returns
array
PHPUnit_Framework_TestResult::notImplementedCount ( )

Gets the number of incomplete tests.

Returns
int
PHPUnit_Framework_TestResult::passed ( )

Returns the names of the tests that have passed.

Returns
array
Since
Method available since Release 3.4.0
PHPUnit_Framework_TestResult::removeListener ( PHPUnit_Framework_TestListener  $listener)

Unregisters a TestListener.

Parameters
PHPUnit_Framework_TestListener$listener
PHPUnit_Framework_TestResult::risky ( )

Returns an Enumeration for the risky tests.

Returns
array
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::riskyCount ( )

Gets the number of risky tests.

Returns
int
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::run ( PHPUnit_Framework_Test  $test)

Runs a TestCase.

Parameters
PHPUnit_Framework_Test$test
PHPUnit_Framework_TestResult::setCodeCoverage ( PHP_CodeCoverage  $codeCoverage)

Sets the PHP_CodeCoverage object.

Parameters
PHP_CodeCoverage$codeCoverage
Since
Method available since Release 3.6.0
PHPUnit_Framework_TestResult::setTimeoutForLargeTests (   $timeout)

Sets the timeout for large tests.

Parameters
int$timeout
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 3.6.0
PHPUnit_Framework_TestResult::setTimeoutForMediumTests (   $timeout)

Sets the timeout for medium tests.

Parameters
int$timeout
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 3.6.0
PHPUnit_Framework_TestResult::setTimeoutForSmallTests (   $timeout)

Sets the timeout for small tests.

Parameters
int$timeout
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 3.6.0
PHPUnit_Framework_TestResult::shouldStop ( )

Checks whether the test run should stop.

Returns
bool
PHPUnit_Framework_TestResult::skipped ( )

Returns an Enumeration for the skipped tests.

Returns
array
Since
Method available since Release 3.0.0
PHPUnit_Framework_TestResult::skippedCount ( )

Gets the number of skipped tests.

Returns
int
Since
Method available since Release 3.0.0
PHPUnit_Framework_TestResult::startTest ( PHPUnit_Framework_Test  $test)

Informs the result that a test will be started.

Parameters
PHPUnit_Framework_Test$test
PHPUnit_Framework_TestResult::startTestSuite ( PHPUnit_Framework_TestSuite  $suite)

Informs the result that a testsuite will be started.

Parameters
PHPUnit_Framework_TestSuite$suite
Since
Method available since Release 2.2.0
PHPUnit_Framework_TestResult::stop ( )

Marks that the test run should stop.

PHPUnit_Framework_TestResult::stopOnError (   $flag)

Enables or disables the stopping when an error occurs.

Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 3.5.0
PHPUnit_Framework_TestResult::stopOnFailure (   $flag)

Enables or disables the stopping when a failure occurs.

Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 3.1.0
PHPUnit_Framework_TestResult::stopOnIncomplete (   $flag)

Enables or disables the stopping for incomplete tests.

Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 3.5.0
PHPUnit_Framework_TestResult::stopOnRisky (   $flag)

Enables or disables the stopping for risky tests.

Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestResult::stopOnSkipped (   $flag)

Enables or disables the stopping for skipped tests.

Parameters
bool$flag
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 3.1.0
PHPUnit_Framework_TestResult::time ( )

Returns the time spent running the tests.

Returns
float
PHPUnit_Framework_TestResult::topTestSuite ( )

Returns the (top) test suite.

Returns
PHPUnit_Framework_TestSuite
Since
Method available since Release 3.0.0
PHPUnit_Framework_TestResult::wasSuccessful ( )

Returns whether the entire test was successful or not.

Returns
bool

The documentation for this class was generated from the following file: