PHP Класс PHPUnit_Framework_TestResult, phpunit

Автор: Sebastian Bergmann ([email protected])
Наследование: implements Countable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
getHierarchy ( string $className, boolean $asReflectionObjects = false ) : array Returns the class hierarchy for a given class.

Описание методов

addError() публичный Метод

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() публичный Метод

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() публичный Метод

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

addWarning() публичный Метод

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() публичный Метод

Returns true if no incomplete test occurred.
public allCompletelyImplemented ( ) : boolean
Результат boolean

allHarmless() публичный Метод

Returns true if no risky test occurred.
public allHarmless ( ) : boolean
Результат boolean

beStrictAboutOutputDuringTests() публичный Метод

beStrictAboutResourceUsageDuringSmallTests() публичный Метод

beStrictAboutTestsThatDoNotTestAnything() публичный Метод

beStrictAboutTodoAnnotatedTests() публичный Метод

convertErrorsToExceptions() публичный Метод

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

count() публичный Метод

Gets the number of run tests.
public count ( ) : integer
Результат integer

endTest() публичный Метод

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

endTestSuite() публичный Метод

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

enforceTimeLimit() публичный Метод

public enforceTimeLimit ( boolean $flag )
$flag boolean

enforcesTimeLimit() публичный Метод

public enforcesTimeLimit ( ) : boolean
Результат boolean

errorCount() публичный Метод

Gets the number of detected errors.
public errorCount ( ) : integer
Результат integer

errors() публичный Метод

Returns an Enumeration for the errors.
public errors ( ) : array
Результат array

failureCount() публичный Метод

Gets the number of detected failures.
public failureCount ( ) : integer
Результат integer

failures() публичный Метод

Returns an Enumeration for the failures.
public failures ( ) : array
Результат array

flushListeners() публичный Метод

Flushes all flushable TestListeners.
public flushListeners ( )

getCodeCoverage() публичный Метод

Returns the code coverage object.
public getCodeCoverage ( ) : SebastianBergmann\CodeCoverage\CodeCoverage
Результат SebastianBergmann\CodeCoverage\CodeCoverage

getCollectCodeCoverageInformation() публичный Метод

Returns whether code coverage information should be collected.
public getCollectCodeCoverageInformation ( ) : boolean
Результат boolean If code coverage should be collected

getConvertErrorsToExceptions() публичный Метод

Returns the error-to-exception conversion setting.
public getConvertErrorsToExceptions ( ) : boolean
Результат boolean

getHierarchy() защищенный Метод

Returns the class hierarchy for a given class.
protected getHierarchy ( string $className, boolean $asReflectionObjects = false ) : array
$className string
$asReflectionObjects boolean
Результат array

getTimeoutForLargeTests() публичный Метод

Returns the set timeout for large tests.
public getTimeoutForLargeTests ( ) : integer
Результат integer

isStrictAboutOutputDuringTests() публичный Метод

public isStrictAboutOutputDuringTests ( ) : boolean
Результат boolean

isStrictAboutResourceUsageDuringSmallTests() публичный Метод

isStrictAboutTestsThatDoNotTestAnything() публичный Метод

public isStrictAboutTestsThatDoNotTestAnything ( ) : boolean
Результат boolean

isStrictAboutTodoAnnotatedTests() публичный Метод

public isStrictAboutTodoAnnotatedTests ( ) : boolean
Результат boolean

noneSkipped() публичный Метод

Returns true if no test has been skipped.
public noneSkipped ( ) : boolean
Результат boolean

notImplemented() публичный Метод

Returns an Enumeration for the incomplete tests.
public notImplemented ( ) : array
Результат array

notImplementedCount() публичный Метод

Gets the number of incomplete tests.
public notImplementedCount ( ) : integer
Результат integer

passed() публичный Метод

Returns the names of the tests that have passed.
public passed ( ) : array
Результат array

removeListener() публичный Метод

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

risky() публичный Метод

Returns an Enumeration for the risky tests.
public risky ( ) : array
Результат array

riskyCount() публичный Метод

Gets the number of risky tests.
public riskyCount ( ) : integer
Результат integer

run() публичный Метод

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

setCodeCoverage() публичный Метод

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

setRegisterMockObjectsFromTestArgumentsRecursively() публичный Метод

setTimeoutForLargeTests() публичный Метод

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

setTimeoutForMediumTests() публичный Метод

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

setTimeoutForSmallTests() публичный Метод

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

shouldStop() публичный Метод

Checks whether the test run should stop.
public shouldStop ( ) : boolean
Результат boolean

skipped() публичный Метод

Returns an Enumeration for the skipped tests.
public skipped ( ) : array
Результат array

skippedCount() публичный Метод

Gets the number of skipped tests.
public skippedCount ( ) : integer
Результат integer

startTest() публичный Метод

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

startTestSuite() публичный Метод

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

stop() публичный Метод

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

stopOnError() публичный Метод

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

stopOnFailure() публичный Метод

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

stopOnIncomplete() публичный Метод

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

stopOnRisky() публичный Метод

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

stopOnSkipped() публичный Метод

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

stopOnWarning() публичный Метод

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

time() публичный Метод

Returns the time spent running the tests.
public time ( ) : float
Результат float

topTestSuite() публичный Метод

Returns the (top) test suite.
public topTestSuite ( ) : PHPUnit_Framework_TestSuite
Результат PHPUnit_Framework_TestSuite

warningCount() публичный Метод

Gets the number of detected warnings.
public warningCount ( ) : integer
Результат integer

warnings() публичный Метод

Returns an Enumeration for the warnings.
public warnings ( ) : array
Результат array

wasSuccessful() публичный Метод

Returns whether the entire test was successful or not.
public wasSuccessful ( ) : boolean
Результат boolean

Описание свойств

$beStrictAboutOutputDuringTests защищенное свойство

protected bool $beStrictAboutOutputDuringTests
Результат boolean

$beStrictAboutResourceUsageDuringSmallTests защищенное свойство

protected bool $beStrictAboutResourceUsageDuringSmallTests
Результат boolean

$beStrictAboutTestsThatDoNotTestAnything защищенное свойство

protected bool $beStrictAboutTestsThatDoNotTestAnything
Результат boolean

$beStrictAboutTodoAnnotatedTests защищенное свойство

protected bool $beStrictAboutTodoAnnotatedTests
Результат boolean

$codeCoverage защищенное свойство

Code Coverage information.
protected CodeCoverage,SebastianBergmann\CodeCoverage $codeCoverage
Результат SebastianBergmann\CodeCoverage\CodeCoverage

$convertErrorsToExceptions защищенное свойство

protected bool $convertErrorsToExceptions
Результат boolean

$enforceTimeLimit защищенное свойство

protected bool $enforceTimeLimit
Результат boolean

$errors защищенное свойство

protected array $errors
Результат array

$failures защищенное свойство

protected array $failures
Результат array

$lastTestFailed защищенное свойство

protected bool $lastTestFailed
Результат boolean

$listeners защищенное свойство

protected array $listeners
Результат array

$notImplemented защищенное свойство

protected array $notImplemented
Результат array

$passed защищенное свойство

protected array $passed
Результат array

$risky защищенное свойство

protected array $risky
Результат array

$runTests защищенное свойство

protected int $runTests
Результат integer

$skipped защищенное свойство

protected array $skipped
Результат array

$stop защищенное свойство

protected bool $stop
Результат boolean

$stopOnError защищенное свойство

protected bool $stopOnError
Результат boolean

$stopOnFailure защищенное свойство

protected bool $stopOnFailure
Результат boolean

$stopOnIncomplete защищенное свойство

protected bool $stopOnIncomplete
Результат boolean

$stopOnRisky защищенное свойство

protected bool $stopOnRisky
Результат boolean

$stopOnSkipped защищенное свойство

protected bool $stopOnSkipped
Результат boolean

$stopOnWarning защищенное свойство

protected bool $stopOnWarning
Результат boolean

$time защищенное свойство

protected float $time
Результат float

$timeoutForLargeTests защищенное свойство

protected int $timeoutForLargeTests
Результат integer

$timeoutForMediumTests защищенное свойство

protected int $timeoutForMediumTests
Результат integer

$timeoutForSmallTests защищенное свойство

protected int $timeoutForSmallTests
Результат integer

$topTestSuite защищенное свойство

protected PHPUnit_Framework_TestSuite $topTestSuite
Результат PHPUnit_Framework_TestSuite

$warnings защищенное свойство

protected array $warnings
Результат array