PHP Class PHPUnit_Framework_TestResult, phpunit

Author: Sebastian Bergmann ([email protected])
Inheritance: implements Countable
Afficher le fichier Open project: sebastianbergmann/phpunit Class Usage Examples

Protected Properties

Свойство Type Description
$beStrictAboutOutputDuringTests boolean
$beStrictAboutResourceUsageDuringSmallTests boolean
$beStrictAboutTestsThatDoNotTestAnything boolean
$beStrictAboutTodoAnnotatedTests boolean
$codeCoverage SebastianBergmann\CodeCoverage\CodeCoverage Code Coverage information.
$convertErrorsToExceptions boolean
$enforceTimeLimit boolean
$errors array
$failures array
$lastTestFailed boolean
$listeners array
$notImplemented array
$passed array
$risky array
$runTests integer
$skipped array
$stop boolean
$stopOnError boolean
$stopOnFailure boolean
$stopOnIncomplete boolean
$stopOnRisky boolean
$stopOnSkipped boolean
$stopOnWarning boolean
$time float
$timeoutForLargeTests integer
$timeoutForMediumTests integer
$timeoutForSmallTests integer
$topTestSuite PHPUnit_Framework_TestSuite
$warnings array

Méthodes publiques

Méthode Description
addError ( PHPUnit_Framework_Test $test, Throwable $t, float $time ) Adds an error to the list of errors.
addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time ) Adds a failure to the list of failures.
addListener ( PHPUnit_Framework_TestListener $listener ) Registers a TestListener.
addWarning ( PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, float $time ) Adds a warning to the list of warnings.
allCompletelyImplemented ( ) : boolean Returns true if no incomplete test occurred.
allHarmless ( ) : boolean Returns true if no risky test occurred.
beStrictAboutOutputDuringTests ( boolean $flag )
beStrictAboutResourceUsageDuringSmallTests ( boolean $flag )
beStrictAboutTestsThatDoNotTestAnything ( boolean $flag )
beStrictAboutTodoAnnotatedTests ( boolean $flag )
convertErrorsToExceptions ( boolean $flag ) Enables or disables the error-to-exception conversion.
count ( ) : integer Gets the number of run tests.
endTest ( PHPUnit_Framework_Test $test, float $time ) Informs the result that a test was completed.
endTestSuite ( PHPUnit_Framework_TestSuite $suite ) Informs the result that a testsuite was completed.
enforceTimeLimit ( boolean $flag )
enforcesTimeLimit ( ) : boolean
errorCount ( ) : integer Gets the number of detected errors.
errors ( ) : array Returns an Enumeration for the errors.
failureCount ( ) : integer Gets the number of detected failures.
failures ( ) : array Returns an Enumeration for the failures.
flushListeners ( ) Flushes all flushable TestListeners.
getCodeCoverage ( ) : SebastianBergmann\CodeCoverage\CodeCoverage Returns the code coverage object.
getCollectCodeCoverageInformation ( ) : boolean Returns whether code coverage information should be collected.
getConvertErrorsToExceptions ( ) : boolean Returns the error-to-exception conversion setting.
getTimeoutForLargeTests ( ) : integer Returns the set timeout for large tests.
isStrictAboutOutputDuringTests ( ) : boolean
isStrictAboutResourceUsageDuringSmallTests ( ) : boolean
isStrictAboutTestsThatDoNotTestAnything ( ) : boolean
isStrictAboutTodoAnnotatedTests ( ) : boolean
noneSkipped ( ) : boolean Returns true if no test has been skipped.
notImplemented ( ) : array Returns an Enumeration for the incomplete tests.
notImplementedCount ( ) : integer Gets the number of incomplete tests.
passed ( ) : array Returns the names of the tests that have passed.
removeListener ( PHPUnit_Framework_TestListener $listener ) Unregisters a TestListener.
risky ( ) : array Returns an Enumeration for the risky tests.
riskyCount ( ) : integer Gets the number of risky tests.
run ( PHPUnit_Framework_Test $test ) Runs a TestCase.
setCodeCoverage ( SebastianBergmann\CodeCoverage\CodeCoverage $codeCoverage ) Sets the code coverage object.
setRegisterMockObjectsFromTestArgumentsRecursively ( boolean $flag )
setTimeoutForLargeTests ( integer $timeout ) Sets the timeout for large tests.
setTimeoutForMediumTests ( integer $timeout ) Sets the timeout for medium tests.
setTimeoutForSmallTests ( integer $timeout ) Sets the timeout for small tests.
shouldStop ( ) : boolean Checks whether the test run should stop.
skipped ( ) : array Returns an Enumeration for the skipped tests.
skippedCount ( ) : integer 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 ( boolean $flag ) Enables or disables the stopping when an error occurs.
stopOnFailure ( boolean $flag ) Enables or disables the stopping when a failure occurs.
stopOnIncomplete ( boolean $flag ) Enables or disables the stopping for incomplete tests.
stopOnRisky ( boolean $flag ) Enables or disables the stopping for risky tests.
stopOnSkipped ( boolean $flag ) Enables or disables the stopping for skipped tests.
stopOnWarning ( boolean $flag ) Enables or disables the stopping when a warning occurs.
time ( ) : float Returns the time spent running the tests.
topTestSuite ( ) : PHPUnit_Framework_TestSuite Returns the (top) test suite.
warningCount ( ) : integer Gets the number of detected warnings.
warnings ( ) : array Returns an Enumeration for the warnings.
wasSuccessful ( ) : boolean Returns whether the entire test was successful or not.

Méthodes protégées

Méthode Description
getHierarchy ( string $className, boolean $asReflectionObjects = false ) : array Returns the class hierarchy for a given class.

Method Details

addError() public méthode

Adds an error to the list of errors.
public addError ( PHPUnit_Framework_Test $test, Throwable $t, float $time )
$test PHPUnit_Framework_Test
$t Throwable
$time float

addFailure() public méthode

The passed in exception caused the failure.
public addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time )
$test PHPUnit_Framework_Test
$e PHPUnit_Framework_AssertionFailedError
$time float

addListener() public méthode

Registers a TestListener.
public addListener ( PHPUnit_Framework_TestListener $listener )
$listener PHPUnit_Framework_TestListener

addWarning() public méthode

The passed in exception caused the warning.
public addWarning ( PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, float $time )
$test PHPUnit_Framework_Test
$e PHPUnit_Framework_Warning
$time float

allCompletelyImplemented() public méthode

Returns true if no incomplete test occurred.
public allCompletelyImplemented ( ) : boolean
Résultat boolean

allHarmless() public méthode

Returns true if no risky test occurred.
public allHarmless ( ) : boolean
Résultat boolean

beStrictAboutOutputDuringTests() public méthode

beStrictAboutResourceUsageDuringSmallTests() public méthode

beStrictAboutTestsThatDoNotTestAnything() public méthode

beStrictAboutTodoAnnotatedTests() public méthode

convertErrorsToExceptions() public méthode

Enables or disables the error-to-exception conversion.
public convertErrorsToExceptions ( boolean $flag )
$flag boolean

count() public méthode

Gets the number of run tests.
public count ( ) : integer
Résultat integer

endTest() public méthode

Informs the result that a test was completed.
public endTest ( PHPUnit_Framework_Test $test, float $time )
$test PHPUnit_Framework_Test
$time float

endTestSuite() public méthode

Informs the result that a testsuite was completed.
public endTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

enforceTimeLimit() public méthode

public enforceTimeLimit ( boolean $flag )
$flag boolean

enforcesTimeLimit() public méthode

public enforcesTimeLimit ( ) : boolean
Résultat boolean

errorCount() public méthode

Gets the number of detected errors.
public errorCount ( ) : integer
Résultat integer

errors() public méthode

Returns an Enumeration for the errors.
public errors ( ) : array
Résultat array

failureCount() public méthode

Gets the number of detected failures.
public failureCount ( ) : integer
Résultat integer

failures() public méthode

Returns an Enumeration for the failures.
public failures ( ) : array
Résultat array

flushListeners() public méthode

Flushes all flushable TestListeners.
public flushListeners ( )

getCodeCoverage() public méthode

Returns the code coverage object.
public getCodeCoverage ( ) : SebastianBergmann\CodeCoverage\CodeCoverage
Résultat SebastianBergmann\CodeCoverage\CodeCoverage

getCollectCodeCoverageInformation() public méthode

Returns whether code coverage information should be collected.
public getCollectCodeCoverageInformation ( ) : boolean
Résultat boolean If code coverage should be collected

getConvertErrorsToExceptions() public méthode

Returns the error-to-exception conversion setting.

getHierarchy() protected méthode

Returns the class hierarchy for a given class.
protected getHierarchy ( string $className, boolean $asReflectionObjects = false ) : array
$className string
$asReflectionObjects boolean
Résultat array

getTimeoutForLargeTests() public méthode

Returns the set timeout for large tests.
public getTimeoutForLargeTests ( ) : integer
Résultat integer

isStrictAboutOutputDuringTests() public méthode

isStrictAboutResourceUsageDuringSmallTests() public méthode

isStrictAboutTestsThatDoNotTestAnything() public méthode

isStrictAboutTodoAnnotatedTests() public méthode

noneSkipped() public méthode

Returns true if no test has been skipped.
public noneSkipped ( ) : boolean
Résultat boolean

notImplemented() public méthode

Returns an Enumeration for the incomplete tests.
public notImplemented ( ) : array
Résultat array

notImplementedCount() public méthode

Gets the number of incomplete tests.
public notImplementedCount ( ) : integer
Résultat integer

passed() public méthode

Returns the names of the tests that have passed.
public passed ( ) : array
Résultat array

removeListener() public méthode

Unregisters a TestListener.
public removeListener ( PHPUnit_Framework_TestListener $listener )
$listener PHPUnit_Framework_TestListener

risky() public méthode

Returns an Enumeration for the risky tests.
public risky ( ) : array
Résultat array

riskyCount() public méthode

Gets the number of risky tests.
public riskyCount ( ) : integer
Résultat integer

run() public méthode

Runs a TestCase.
public run ( PHPUnit_Framework_Test $test )
$test PHPUnit_Framework_Test

setCodeCoverage() public méthode

Sets the code coverage object.
public setCodeCoverage ( SebastianBergmann\CodeCoverage\CodeCoverage $codeCoverage )
$codeCoverage SebastianBergmann\CodeCoverage\CodeCoverage

setRegisterMockObjectsFromTestArgumentsRecursively() public méthode

setTimeoutForLargeTests() public méthode

Sets the timeout for large tests.
public setTimeoutForLargeTests ( integer $timeout )
$timeout integer

setTimeoutForMediumTests() public méthode

Sets the timeout for medium tests.
public setTimeoutForMediumTests ( integer $timeout )
$timeout integer

setTimeoutForSmallTests() public méthode

Sets the timeout for small tests.
public setTimeoutForSmallTests ( integer $timeout )
$timeout integer

shouldStop() public méthode

Checks whether the test run should stop.
public shouldStop ( ) : boolean
Résultat boolean

skipped() public méthode

Returns an Enumeration for the skipped tests.
public skipped ( ) : array
Résultat array

skippedCount() public méthode

Gets the number of skipped tests.
public skippedCount ( ) : integer
Résultat integer

startTest() public méthode

Informs the result that a test will be started.
public startTest ( PHPUnit_Framework_Test $test )
$test PHPUnit_Framework_Test

startTestSuite() public méthode

Informs the result that a testsuite will be started.
public startTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

stop() public méthode

Marks that the test run should stop.
public stop ( )

stopOnError() public méthode

Enables or disables the stopping when an error occurs.
public stopOnError ( boolean $flag )
$flag boolean

stopOnFailure() public méthode

Enables or disables the stopping when a failure occurs.
public stopOnFailure ( boolean $flag )
$flag boolean

stopOnIncomplete() public méthode

Enables or disables the stopping for incomplete tests.
public stopOnIncomplete ( boolean $flag )
$flag boolean

stopOnRisky() public méthode

Enables or disables the stopping for risky tests.
public stopOnRisky ( boolean $flag )
$flag boolean

stopOnSkipped() public méthode

Enables or disables the stopping for skipped tests.
public stopOnSkipped ( boolean $flag )
$flag boolean

stopOnWarning() public méthode

Enables or disables the stopping when a warning occurs.
public stopOnWarning ( boolean $flag )
$flag boolean

time() public méthode

Returns the time spent running the tests.
public time ( ) : float
Résultat float

topTestSuite() public méthode

Returns the (top) test suite.
public topTestSuite ( ) : PHPUnit_Framework_TestSuite
Résultat PHPUnit_Framework_TestSuite

warningCount() public méthode

Gets the number of detected warnings.
public warningCount ( ) : integer
Résultat integer

warnings() public méthode

Returns an Enumeration for the warnings.
public warnings ( ) : array
Résultat array

wasSuccessful() public méthode

Returns whether the entire test was successful or not.
public wasSuccessful ( ) : boolean
Résultat boolean

Property Details

$beStrictAboutOutputDuringTests protected_oe property

protected bool $beStrictAboutOutputDuringTests
Résultat boolean

$beStrictAboutResourceUsageDuringSmallTests protected_oe property

protected bool $beStrictAboutResourceUsageDuringSmallTests
Résultat boolean

$beStrictAboutTestsThatDoNotTestAnything protected_oe property

protected bool $beStrictAboutTestsThatDoNotTestAnything
Résultat boolean

$beStrictAboutTodoAnnotatedTests protected_oe property

protected bool $beStrictAboutTodoAnnotatedTests
Résultat boolean

$codeCoverage protected_oe property

Code Coverage information.
protected CodeCoverage,SebastianBergmann\CodeCoverage $codeCoverage
Résultat SebastianBergmann\CodeCoverage\CodeCoverage

$convertErrorsToExceptions protected_oe property

protected bool $convertErrorsToExceptions
Résultat boolean

$enforceTimeLimit protected_oe property

protected bool $enforceTimeLimit
Résultat boolean

$errors protected_oe property

protected array $errors
Résultat array

$failures protected_oe property

protected array $failures
Résultat array

$lastTestFailed protected_oe property

protected bool $lastTestFailed
Résultat boolean

$listeners protected_oe property

protected array $listeners
Résultat array

$notImplemented protected_oe property

protected array $notImplemented
Résultat array

$passed protected_oe property

protected array $passed
Résultat array

$risky protected_oe property

protected array $risky
Résultat array

$runTests protected_oe property

protected int $runTests
Résultat integer

$skipped protected_oe property

protected array $skipped
Résultat array

$stop protected_oe property

protected bool $stop
Résultat boolean

$stopOnError protected_oe property

protected bool $stopOnError
Résultat boolean

$stopOnFailure protected_oe property

protected bool $stopOnFailure
Résultat boolean

$stopOnIncomplete protected_oe property

protected bool $stopOnIncomplete
Résultat boolean

$stopOnRisky protected_oe property

protected bool $stopOnRisky
Résultat boolean

$stopOnSkipped protected_oe property

protected bool $stopOnSkipped
Résultat boolean

$stopOnWarning protected_oe property

protected bool $stopOnWarning
Résultat boolean

$time protected_oe property

protected float $time
Résultat float

$timeoutForLargeTests protected_oe property

protected int $timeoutForLargeTests
Résultat integer

$timeoutForMediumTests protected_oe property

protected int $timeoutForMediumTests
Résultat integer

$timeoutForSmallTests protected_oe property

protected int $timeoutForSmallTests
Résultat integer

$topTestSuite protected_oe property

protected PHPUnit_Framework_TestSuite $topTestSuite
Résultat PHPUnit_Framework_TestSuite

$warnings protected_oe property

protected array $warnings
Résultat array