TestCase class abstract

PHPUnit\Framework\TestCase

Extends PHPUnit\Framework\Assert

Implements: PHPUnit\Framework\Reorderable, PHPUnit\Framework\SelfDescribing, PHPUnit\Framework\Test, Countable

Defined in D:/WEBISTERS/projects/app/vendor/phpunit/phpunit/src/Framework/TestCase.php

Constants #

LOCALE_CATEGORIES
-

Properties #

$backupGlobals
-
$backupGlobalsExcludeList
-
$backupStaticProperties
-
$backupStaticPropertiesExcludeList
-
$snapshot
-
$backupGlobalErrorHandlers
-
$backupGlobalExceptionHandlers
-
$runClassInSeparateProcess
-
$runTestInSeparateProcess
-
$preserveGlobalState
-
$inIsolation
-
$expectedException
-
$expectedExceptionMessage
-
$expectedExceptionMessageRegExp
-
$expectedExceptionCode
-
$providedTests
-
$data
-
$dataName
-
$methodName
-
$groups
-
$dependencies
-
$dependencyInput
-
$iniSettings
-
$locale
-
$mockObjects
-
$status
-
$numberOfAssertionsPerformed
-
$testResult
-
$output
-
$outputExpectedRegex
-
$outputExpectedString
-
$outputBufferingActive
-
$outputBufferingLevel
-
$outputRetrievedForAssertion
-
$doesNotPerformAssertions
-
$customComparators
-
$testValueObjectForEvents
-
$wasPrepared
-
$failureTypes
-
$expectedUserDeprecationMessage
-
$expectedUserDeprecationMessageRegularExpression
-

$backupGlobals

private ?bool $backupGlobals = NULL

$backupGlobalsExcludeList

private array $backupGlobalsExcludeList = array ( )

$backupStaticProperties

private ?bool $backupStaticProperties = NULL

$backupStaticPropertiesExcludeList

private array $backupStaticPropertiesExcludeList = array ( )

$snapshot

private ?\SebastianBergmann\GlobalState\Snapshot $snapshot = NULL

$backupGlobalErrorHandlers

private ?array $backupGlobalErrorHandlers = NULL

$backupGlobalExceptionHandlers

private ?array $backupGlobalExceptionHandlers = NULL

$runClassInSeparateProcess

private ?bool $runClassInSeparateProcess = NULL

$runTestInSeparateProcess

private ?bool $runTestInSeparateProcess = NULL

$preserveGlobalState

private bool $preserveGlobalState = false

$inIsolation

private bool $inIsolation = false

$expectedException

private ?string $expectedException = NULL

$expectedExceptionMessage

private ?string $expectedExceptionMessage = NULL

$expectedExceptionMessageRegExp

private ?string $expectedExceptionMessageRegExp = NULL

$expectedExceptionCode

private string|int|null $expectedExceptionCode = NULL

$providedTests

private array $providedTests = array ( )

$data

private array $data = array ( )

$dataName

private string|int $dataName = ''

$methodName

private string $methodName

$groups

private array $groups = array ( )

$dependencies

private array $dependencies = array ( )

$dependencyInput

private array $dependencyInput = array ( )

$iniSettings

private array $iniSettings = array ( )

$locale

private array $locale = array ( )

$mockObjects

private array $mockObjects = array ( )

$status

private \PHPUnit\Framework\TestStatus\TestStatus $status

$numberOfAssertionsPerformed

private int $numberOfAssertionsPerformed = 0

$testResult

private mixed $testResult = NULL

$output

private string $output = ''

$outputExpectedRegex

private ?string $outputExpectedRegex = NULL

$outputExpectedString

private ?string $outputExpectedString = NULL

$outputBufferingActive

private bool $outputBufferingActive = false

$outputBufferingLevel

private int $outputBufferingLevel

$outputRetrievedForAssertion

private bool $outputRetrievedForAssertion = false

$doesNotPerformAssertions

private bool $doesNotPerformAssertions = false

$customComparators

private array $customComparators = array ( )

$testValueObjectForEvents

private ?\PHPUnit\Event\Code\TestMethod $testValueObjectForEvents = NULL

$wasPrepared

private bool $wasPrepared = false

$failureTypes

private array $failureTypes = array ( )

$expectedUserDeprecationMessage

private array $expectedUserDeprecationMessage = array ( )

$expectedUserDeprecationMessageRegularExpression

private array $expectedUserDeprecationMessageRegularExpression = array ( )

Methods #

__construct()
-
addToAssertionCount()
-
count()
-
dataName()
-
dataSetAsString()
-
dataSetAsStringWithData()
-
dependencyInput()
-
doesNotPerformAssertions()
-
expectsOutput()
-
groups()
-
hasDependencyInput()
-
hasUnexpectedOutput()
-
name()
-
nameWithDataSet()
-
numberOfAssertionsPerformed()
-
output()
-
providedData()
-
provides()
-
registerMockObject()
-
requires()
-
result()
-
run()
-
runBare()
-
setBackupGlobals()
-
setBackupGlobalsExcludeList()
-
setBackupStaticProperties()
-
setBackupStaticPropertiesExcludeList()
-
setData()
-
setDependencies()
-
setDependencyInput()
-
setGroups()
-
setInIsolation()
-
setPreserveGlobalState()
-
setResult()
-
setRunClassInSeparateProcess()
-
setRunTestInSeparateProcess()
-
setUpBeforeClass()
This method is called before the first test of this test class is run.
size()
-
sortId()
-
status()
-
tearDownAfterClass()
This method is called after the last test of this test class is run.
toString()
Returns a string representation of the test case.
usesDataProvider()
-
valueObjectForEvents()
-
wasPrepared()
-
any()
Returns a matcher that matches when the method is executed zero or more times.
assertPostConditions()
Performs assertions shared by all tests of a test case.
assertPreConditions()
Performs assertions shared by all tests of a test case.
atLeast()
Returns a matcher that matches when the method is executed at least N times.
atLeastOnce()
Returns a matcher that matches when the method is executed at least once.
atMost()
Returns a matcher that matches when the method is executed at most N times.
createConfiguredMock()
Creates (and configures) a mock object for the specified interface or class.
createConfiguredStub()
Creates (and configures) a test stub for the specified interface or class.
createMock()
Creates a mock object for the specified interface or class.
createMockForIntersectionOfInterfaces()
-
createPartialMock()
Creates a partial mock object for the specified interface or class.
createStub()
Creates a test stub for the specified interface or class.
createStubForIntersectionOfInterfaces()
-
createTestProxy()
Creates a test proxy for the specified class.
exactly()
Returns a matcher that matches when the method is executed exactly $count times.
expectException()
-
expectExceptionCode()
-
expectExceptionMessage()
-
expectExceptionMessageMatches()
-
expectExceptionObject()
Sets up an expectation for an exception to be raised by the code under test. Information for expected exception class, expected exception message, and expected exception code are retrieved from a given Exception object.
expectNotToPerformAssertions()
-
expectOutputRegex()
-
expectOutputString()
-
expectUserDeprecationMessage()
-
expectUserDeprecationMessageMatches()
-
getActualOutputForAssertion()
-
getMockBuilder()
Returns a builder object to create mock objects using a fluent interface.
getMockForAbstractClass()
Creates a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default. To mock concrete methods, use the 7th parameter ($mockedMethods).
getMockForTrait()
Creates a mock object for the specified trait with all abstract methods of the trait mocked. Concrete methods to mock can be specified with the `$mockedMethods` parameter.
getMockFromWsdl()
Creates a mock object based on the given WSDL file.
getObjectForTrait()
Creates an object that uses the specified trait.
iniSet()
This method is a wrapper for the ini_set() function that automatically resets the modified php.ini setting to its original value after the test is run.
never()
Returns a matcher that matches when the method is never executed.
onConsecutiveCalls()
-
onNotSuccessfulTest()
This method is called when a test method did not execute successfully.
once()
Returns a matcher that matches when the method is executed exactly once.
registerComparator()
-
registerFailureType()
-
returnArgument()
-
returnCallback()
-
returnSelf()
-
returnValue()
-
returnValueMap()
-
setLocale()
This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.
setUp()
This method is called before each test.
tearDown()
This method is called after each test.
throwException()
-
transformException()
-
activeErrorHandlers()
-
activeExceptionHandlers()
-
checkRequirements()
-
cleanupIniSettings()
-
cleanupLocaleSettings()
-
compareGlobalStateSnapshotPart()
-
compareGlobalStateSnapshots()
-
createGlobalStateSnapshot()
-
expectedExceptionWasNotRaised()
-
generateReturnValuesForTestDoubles()
-
handleDependencies()
-
handleExceptionFromInvokedCountMockObjectRule()
-
hasExpectationOnOutput()
-
invokeAfterClassHookMethods()
-
invokeAfterTestHookMethods()
-
invokeBeforeClassHookMethods()
-
invokeBeforeTestHookMethods()
-
invokeHookMethods()
-
invokePostConditionHookMethods()
-
invokePreConditionHookMethods()
-
isCallableTestMethod()
-
isRegisteredFailure()
-
markErrorForInvalidDependency()
-
markSkippedForMissingDependency()
-
methodDoesNotExistOrIsDeclaredInTestCase()
-
performAssertionsOnOutput()
-
requirementsNotSatisfied()
-
requiresXdebug()
-
restoreGlobalErrorExceptionHandlers()
-
restoreGlobalState()
-
runTest()
-
shouldExceptionExpectationsBeVerified()
-
shouldInvocationMockerBeReset()
-
shouldRunInSeparateProcess()
-
snapshotGlobalErrorExceptionHandlers()
-
snapshotGlobalState()
-
startOutputBuffering()
-
stopOutputBuffering()
-
unregisterCustomComparators()
-
verifyDeprecationExpectations()
-
verifyExceptionExpectations()
-
verifyMockObjects()
-

__construct()

public function __construct(string $name)
Parameters
  • string $name

addToAssertionCount()

public final function addToAssertionCount(int $count): void
Parameters
  • int $count
Returns void

count()

public final function count(): int
Returns int

dataName()

public final function dataName(): string|int
Returns string|int

dataSetAsString()

public final function dataSetAsString(): string
Returns string

dataSetAsStringWithData()

public final function dataSetAsStringWithData(): string
Returns string

dependencyInput()

public final function dependencyInput(): array
Returns array - array<mixed>>

doesNotPerformAssertions()

public final function doesNotPerformAssertions(): bool
Returns bool

expectsOutput()

public final function expectsOutput(): bool
Returns bool

groups()

public final function groups(): array
Returns array

hasDependencyInput()

public final function hasDependencyInput(): bool
Returns bool

hasUnexpectedOutput()

public final function hasUnexpectedOutput(): bool
Returns bool

name()

public final function name(): string
Returns string

nameWithDataSet()

public final function nameWithDataSet(): string
Returns string

numberOfAssertionsPerformed()

public final function numberOfAssertionsPerformed(): int
Returns int

output()

public final function output(): string
Returns string

providedData()

public final function providedData(): array
Returns array

provides()

public final function provides(): array
Returns array

registerMockObject()

public final function registerMockObject(\PHPUnit\Framework\MockObject\MockObject $mockObject): void
Parameters
  • \PHPUnit\Framework\MockObject\MockObject $mockObject
Returns void

requires()

public final function requires(): array
Returns array

result()

public final function result(): mixed
Returns mixed

run()

public final function run(): void
Returns void
throws
\PHPUnit\Runner\Exception
throws
\PHPUnit\Util\Exception
throws
\SebastianBergmann\CodeCoverage\InvalidArgumentException
throws
\SebastianBergmann\Template\InvalidArgumentException
throws
CodeCoverageException
throws
Exception
throws
NoPreviousThrowableException
throws
ProcessIsolationException
throws
UnintentionallyCoveredCodeException

runBare()

public final function runBare(): void
Returns void
throws
Throwable

setBackupGlobals()

public final function setBackupGlobals(bool $backupGlobals): void
Parameters
  • bool $backupGlobals
Returns void

setBackupGlobalsExcludeList()

public final function setBackupGlobalsExcludeList(array $backupGlobalsExcludeList): void
Parameters
  • array $backupGlobalsExcludeList
Returns void

setBackupStaticProperties()

public final function setBackupStaticProperties(bool $backupStaticProperties): void
Parameters
  • bool $backupStaticProperties
Returns void

setBackupStaticPropertiesExcludeList()

public final function setBackupStaticPropertiesExcludeList(array $backupStaticPropertiesExcludeList): void
Parameters
  • array $backupStaticPropertiesExcludeList
Returns void

setData()

public final function setData(string|int $dataName, array $data): void
Parameters
  • string|int $dataName
  • array $data
Returns void

setDependencies()

public final function setDependencies(array $dependencies): void
Parameters
  • array $dependencies
Returns void

setDependencyInput()

public final function setDependencyInput(array $dependencyInput): void
Parameters
  • array $dependencyInput
Returns void

setGroups()

public final function setGroups(array $groups): void
Parameters
  • array $groups
Returns void

setInIsolation()

public final function setInIsolation(bool $inIsolation): void
Parameters
  • bool $inIsolation
Returns void

setPreserveGlobalState()

public final function setPreserveGlobalState(bool $preserveGlobalState): void
Parameters
  • bool $preserveGlobalState
Returns void

setResult()

public final function setResult(mixed $result): void
Parameters
  • mixed $result
Returns void

setRunClassInSeparateProcess()

public final function setRunClassInSeparateProcess(bool $runClassInSeparateProcess): void
Parameters
  • bool $runClassInSeparateProcess
Returns void

setRunTestInSeparateProcess()

public final function setRunTestInSeparateProcess(bool $runTestInSeparateProcess): void
Parameters
  • bool $runTestInSeparateProcess
Returns void

setUpBeforeClass()

public static function setUpBeforeClass(): void

This method is called before the first test of this test class is run.

Returns void

size()

public final function size(): \PHPUnit\Framework\TestSize\TestSize
Returns \PHPUnit\Framework\TestSize\TestSize

sortId()

public final function sortId(): string
Returns string

status()

public final function status(): \PHPUnit\Framework\TestStatus\TestStatus
Returns \PHPUnit\Framework\TestStatus\TestStatus

tearDownAfterClass()

public static function tearDownAfterClass(): void

This method is called after the last test of this test class is run.

Returns void

toString()

public function toString(): string

Returns a string representation of the test case.

Returns string
throws
Exception

usesDataProvider()

public final function usesDataProvider(): bool
Returns bool

valueObjectForEvents()

public final function valueObjectForEvents(): \PHPUnit\Event\Code\TestMethod
Returns \PHPUnit\Event\Code\TestMethod

wasPrepared()

public final function wasPrepared(): bool
Returns bool

any()

protected final function any(): \PHPUnit\Framework\MockObject\Rule\AnyInvokedCount

Returns a matcher that matches when the method is executed zero or more times.

Returns \PHPUnit\Framework\MockObject\Rule\AnyInvokedCount

assertPostConditions()

protected function assertPostConditions(): void

Performs assertions shared by all tests of a test case.

This method is called between test and tearDown().

Returns void

assertPreConditions()

protected function assertPreConditions(): void

Performs assertions shared by all tests of a test case.

This method is called between setUp() and test.

Returns void

atLeast()

protected final function atLeast(int $requiredInvocations): \PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount

Returns a matcher that matches when the method is executed at least N times.

Parameters
  • int $requiredInvocations
Returns \PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount

atLeastOnce()

protected final function atLeastOnce(): \PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce

Returns a matcher that matches when the method is executed at least once.

Returns \PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce

atMost()

protected final function atMost(int $allowedInvocations): \PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount

Returns a matcher that matches when the method is executed at most N times.

Parameters
  • int $allowedInvocations
Returns \PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount

createConfiguredMock()

protected final function createConfiguredMock(string $originalClassName, array $configuration): \PHPUnit\Framework\MockObject\MockObject

Creates (and configures) a mock object for the specified interface or class.

Parameters
  • string $originalClassName
  • array $configuration
Returns \PHPUnit\Framework\MockObject\MockObject
throws
InvalidArgumentException
throws
MockObjectException
throws
NoPreviousThrowableException

createConfiguredStub()

protected static final function createConfiguredStub(string $originalClassName, array $configuration): \PHPUnit\Framework\MockObject\Stub

Creates (and configures) a test stub for the specified interface or class.

Parameters
  • string $originalClassName
  • array $configuration
Returns \PHPUnit\Framework\MockObject\Stub
throws
InvalidArgumentException
throws
MockObjectException
throws
NoPreviousThrowableException

createMock()

protected final function createMock(string $originalClassName): \PHPUnit\Framework\MockObject\MockObject

Creates a mock object for the specified interface or class.

Parameters
  • string $originalClassName
Returns \PHPUnit\Framework\MockObject\MockObject
throws
InvalidArgumentException
throws
MockObjectException
throws
NoPreviousThrowableException

createMockForIntersectionOfInterfaces()

protected final function createMockForIntersectionOfInterfaces(array $interfaces): \PHPUnit\Framework\MockObject\MockObject
Parameters
  • array $interfaces
Returns \PHPUnit\Framework\MockObject\MockObject
throws
MockObjectException

createPartialMock()

protected final function createPartialMock(string $originalClassName, array $methods): \PHPUnit\Framework\MockObject\MockObject

Creates a partial mock object for the specified interface or class.

Parameters
  • string $originalClassName
  • array $methods
Returns \PHPUnit\Framework\MockObject\MockObject
throws
InvalidArgumentException
throws
MockObjectException

createStub()

protected static final function createStub(string $originalClassName): \PHPUnit\Framework\MockObject\Stub

Creates a test stub for the specified interface or class.

Parameters
  • string $originalClassName
Returns \PHPUnit\Framework\MockObject\Stub
throws
InvalidArgumentException
throws
MockObjectException
throws
NoPreviousThrowableException

createStubForIntersectionOfInterfaces()

protected static final function createStubForIntersectionOfInterfaces(array $interfaces): \PHPUnit\Framework\MockObject\Stub
Parameters
  • array $interfaces
Returns \PHPUnit\Framework\MockObject\Stub
throws
MockObjectException

createTestProxy()

protected final function createTestProxy(string $originalClassName, array $constructorArguments = array ( )): \PHPUnit\Framework\MockObject\MockObject

Creates a test proxy for the specified class.

Parameters
  • string $originalClassName
  • array $constructorArguments
Returns \PHPUnit\Framework\MockObject\MockObject
throws
InvalidArgumentException
throws
MockObjectException

exactly()

protected final function exactly(int $count): \PHPUnit\Framework\MockObject\Rule\InvokedCount

Returns a matcher that matches when the method is executed exactly $count times.

Parameters
  • int $count
Returns \PHPUnit\Framework\MockObject\Rule\InvokedCount

expectException()

protected final function expectException(string $exception): void
Parameters
  • string $exception
Returns void

expectExceptionCode()

protected final function expectExceptionCode(string|int $code): void
Parameters
  • string|int $code
Returns void

expectExceptionMessage()

protected final function expectExceptionMessage(string $message): void
Parameters
  • string $message
Returns void

expectExceptionMessageMatches()

protected final function expectExceptionMessageMatches(string $regularExpression): void
Parameters
  • string $regularExpression
Returns void

expectExceptionObject()

protected final function expectExceptionObject(Exception $exception): void

Sets up an expectation for an exception to be raised by the code under test. Information for expected exception class, expected exception message, and expected exception code are retrieved from a given Exception object.

Parameters
  • Exception $exception
Returns void

expectNotToPerformAssertions()

protected final function expectNotToPerformAssertions(): void
Returns void

expectOutputRegex()

protected final function expectOutputRegex(string $expectedRegex): void
Parameters
  • string $expectedRegex
Returns void

expectOutputString()

protected final function expectOutputString(string $expectedString): void
Parameters
  • string $expectedString
Returns void

expectUserDeprecationMessage()

protected final function expectUserDeprecationMessage(string $expectedUserDeprecationMessage): void
Parameters
  • string $expectedUserDeprecationMessage
Returns void

expectUserDeprecationMessageMatches()

protected final function expectUserDeprecationMessageMatches(string $expectedUserDeprecationMessageRegularExpression): void
Parameters
  • string $expectedUserDeprecationMessageRegularExpression
Returns void

getActualOutputForAssertion()

protected final function getActualOutputForAssertion(): string
Returns string

getMockBuilder()

protected final function getMockBuilder(string $className): \PHPUnit\Framework\MockObject\MockBuilder

Returns a builder object to create mock objects using a fluent interface.

Parameters
  • string $className
Returns \PHPUnit\Framework\MockObject\MockBuilder

getMockForAbstractClass()

protected final function getMockForAbstractClass(string $originalClassName, array $arguments = array ( ), string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = array ( ), bool $cloneArguments = false): \PHPUnit\Framework\MockObject\MockObject

Creates a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default. To mock concrete methods, use the 7th parameter ($mockedMethods).

Parameters
  • string $originalClassName
  • array $arguments
  • string $mockClassName
  • bool $callOriginalConstructor
  • bool $callOriginalClone
  • bool $callAutoload
  • array $mockedMethods
  • bool $cloneArguments
Returns \PHPUnit\Framework\MockObject\MockObject
throws
InvalidArgumentException
throws
MockObjectException

getMockForTrait()

protected final function getMockForTrait(string $traitName, array $arguments = array ( ), string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = array ( ), bool $cloneArguments = false): \PHPUnit\Framework\MockObject\MockObject

Creates a mock object for the specified trait with all abstract methods of the trait mocked. Concrete methods to mock can be specified with the `$mockedMethods` parameter.

Parameters
  • string $traitName
  • array $arguments
  • string $mockClassName
  • bool $callOriginalConstructor
  • bool $callOriginalClone
  • bool $callAutoload
  • array $mockedMethods
  • bool $cloneArguments
Returns \PHPUnit\Framework\MockObject\MockObject
throws
InvalidArgumentException
throws
MockObjectException

getMockFromWsdl()

protected final function getMockFromWsdl(string $wsdlFile, string $originalClassName = '', string $mockClassName = '', array $methods = array ( ), bool $callOriginalConstructor = true, array $options = array ( )): \PHPUnit\Framework\MockObject\MockObject

Creates a mock object based on the given WSDL file.

Parameters
  • string $wsdlFile
  • string $originalClassName
  • string $mockClassName
  • array $methods
  • bool $callOriginalConstructor
  • array $options
Returns \PHPUnit\Framework\MockObject\MockObject
throws
MockObjectException

getObjectForTrait()

protected final function getObjectForTrait(string $traitName, array $arguments = array ( ), string $traitClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true): object

Creates an object that uses the specified trait.

Parameters
  • string $traitName
  • array $arguments
  • string $traitClassName
  • bool $callOriginalConstructor
  • bool $callOriginalClone
  • bool $callAutoload
Returns object
throws
MockObjectException

iniSet()

protected final function iniSet(string $varName, string $newValue): void

This method is a wrapper for the ini_set() function that automatically resets the modified php.ini setting to its original value after the test is run.

Parameters
  • string $varName
  • string $newValue
Returns void
throws
Exception

never()

protected final function never(): \PHPUnit\Framework\MockObject\Rule\InvokedCount

Returns a matcher that matches when the method is never executed.

Returns \PHPUnit\Framework\MockObject\Rule\InvokedCount

onConsecutiveCalls()

protected final function onConsecutiveCalls(mixed ...$arguments): \PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls
Parameters
  • mixed $arguments
Returns \PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls

onNotSuccessfulTest()

protected function onNotSuccessfulTest(Throwable $t): never

This method is called when a test method did not execute successfully.

Parameters
  • Throwable $t
Returns never
throws
Throwable

once()

protected final function once(): \PHPUnit\Framework\MockObject\Rule\InvokedCount

Returns a matcher that matches when the method is executed exactly once.

Returns \PHPUnit\Framework\MockObject\Rule\InvokedCount

registerComparator()

protected final function registerComparator(\SebastianBergmann\Comparator\Comparator $comparator): void
Parameters
  • \SebastianBergmann\Comparator\Comparator $comparator
Returns void

registerFailureType()

protected final function registerFailureType(string $classOrInterface): void
Parameters
  • string $classOrInterface
Returns void

returnArgument()

protected final function returnArgument(int $argumentIndex): \PHPUnit\Framework\MockObject\Stub\ReturnArgument
Parameters
  • int $argumentIndex
Returns \PHPUnit\Framework\MockObject\Stub\ReturnArgument

returnCallback()

protected final function returnCallback(callable $callback): \PHPUnit\Framework\MockObject\Stub\ReturnCallback
Parameters
  • callable $callback
Returns \PHPUnit\Framework\MockObject\Stub\ReturnCallback

returnSelf()

protected final function returnSelf(): \PHPUnit\Framework\MockObject\Stub\ReturnSelf
Returns \PHPUnit\Framework\MockObject\Stub\ReturnSelf

returnValue()

protected final function returnValue(mixed $value): \PHPUnit\Framework\MockObject\Stub\ReturnStub
Parameters
  • mixed $value
Returns \PHPUnit\Framework\MockObject\Stub\ReturnStub

returnValueMap()

protected final function returnValueMap(array $valueMap): \PHPUnit\Framework\MockObject\Stub\ReturnValueMap
Parameters
  • array $valueMap
Returns \PHPUnit\Framework\MockObject\Stub\ReturnValueMap

setLocale()

protected final function setLocale(mixed ...$arguments): void

This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.

Parameters
  • mixed $arguments
Returns void
throws
Exception

setUp()

protected function setUp(): void

This method is called before each test.

Returns void

tearDown()

protected function tearDown(): void

This method is called after each test.

Returns void

throwException()

protected final function throwException(Throwable $exception): \PHPUnit\Framework\MockObject\Stub\Exception
Parameters
  • Throwable $exception
Returns \PHPUnit\Framework\MockObject\Stub\Exception

transformException()

protected function transformException(Throwable $t): Throwable
Parameters
  • Throwable $t
Returns Throwable

activeErrorHandlers()

private function activeErrorHandlers(): array
Returns array

activeExceptionHandlers()

private function activeExceptionHandlers(): array
Returns array

checkRequirements()

private function checkRequirements(): void
Returns void
throws
SkippedTest

cleanupIniSettings()

private function cleanupIniSettings(): void
Returns void

cleanupLocaleSettings()

private function cleanupLocaleSettings(): void
Returns void

compareGlobalStateSnapshotPart()

private function compareGlobalStateSnapshotPart(array $before, array $after, string $header): void
Parameters
  • array $before
  • array $after
  • string $header
Returns void

compareGlobalStateSnapshots()

private function compareGlobalStateSnapshots(\SebastianBergmann\GlobalState\Snapshot $before, \SebastianBergmann\GlobalState\Snapshot $after): void
Parameters
  • \SebastianBergmann\GlobalState\Snapshot $before
  • \SebastianBergmann\GlobalState\Snapshot $after
Returns void

createGlobalStateSnapshot()

private function createGlobalStateSnapshot(bool $backupGlobals): \SebastianBergmann\GlobalState\Snapshot
Parameters
  • bool $backupGlobals
Returns \SebastianBergmann\GlobalState\Snapshot

expectedExceptionWasNotRaised()

private function expectedExceptionWasNotRaised(): void
Returns void
throws
AssertionFailedError

generateReturnValuesForTestDoubles()

private static function generateReturnValuesForTestDoubles(): bool
Returns bool

handleDependencies()

private function handleDependencies(): bool
Returns bool

handleExceptionFromInvokedCountMockObjectRule()

private function handleExceptionFromInvokedCountMockObjectRule(Throwable $t): void
Parameters
  • Throwable $t
Returns void

hasExpectationOnOutput()

private function hasExpectationOnOutput(): bool
Returns bool

invokeAfterClassHookMethods()

private function invokeAfterClassHookMethods(array $hookMethods, \PHPUnit\Event\Emitter $emitter): void
Parameters
  • array $hookMethods
  • \PHPUnit\Event\Emitter $emitter
Returns void
throws
Throwable

invokeAfterTestHookMethods()

private function invokeAfterTestHookMethods(array $hookMethods, \PHPUnit\Event\Emitter $emitter): void
Parameters
  • array $hookMethods
  • \PHPUnit\Event\Emitter $emitter
Returns void
throws
Throwable

invokeBeforeClassHookMethods()

private function invokeBeforeClassHookMethods(array $hookMethods, \PHPUnit\Event\Emitter $emitter): void
Parameters
  • array $hookMethods
  • \PHPUnit\Event\Emitter $emitter
Returns void
throws
Throwable

invokeBeforeTestHookMethods()

private function invokeBeforeTestHookMethods(array $hookMethods, \PHPUnit\Event\Emitter $emitter): void
Parameters
  • array $hookMethods
  • \PHPUnit\Event\Emitter $emitter
Returns void
throws
Throwable

invokeHookMethods()

private function invokeHookMethods(\PHPUnit\Runner\HookMethodCollection $hookMethods, \PHPUnit\Event\Emitter $emitter, string $calledMethod, string $erroredMethod, string $finishedMethod): void
Parameters
  • \PHPUnit\Runner\HookMethodCollection $hookMethods
  • \PHPUnit\Event\Emitter $emitter
  • string $calledMethod
  • string $erroredMethod
  • string $finishedMethod - *
Returns void
throws
Throwable

invokePostConditionHookMethods()

private function invokePostConditionHookMethods(array $hookMethods, \PHPUnit\Event\Emitter $emitter): void
Parameters
  • array $hookMethods
  • \PHPUnit\Event\Emitter $emitter
Returns void
throws
Throwable

invokePreConditionHookMethods()

private function invokePreConditionHookMethods(array $hookMethods, \PHPUnit\Event\Emitter $emitter): void
Parameters
  • array $hookMethods
  • \PHPUnit\Event\Emitter $emitter
Returns void
throws
Throwable

isCallableTestMethod()

private function isCallableTestMethod(string $dependency): bool
Parameters
  • string $dependency
Returns bool

isRegisteredFailure()

private function isRegisteredFailure(Throwable $t): bool
Parameters
  • Throwable $t
Returns bool

markErrorForInvalidDependency()

private function markErrorForInvalidDependency(?\PHPUnit\Framework\ExecutionOrderDependency $dependency = NULL): void
Parameters
  • ?\PHPUnit\Framework\ExecutionOrderDependency $dependency
Returns void
throws
Exception
throws
NoPreviousThrowableException

markSkippedForMissingDependency()

private function markSkippedForMissingDependency(\PHPUnit\Framework\ExecutionOrderDependency $dependency): void
Parameters
  • \PHPUnit\Framework\ExecutionOrderDependency $dependency
Returns void

methodDoesNotExistOrIsDeclaredInTestCase()

private function methodDoesNotExistOrIsDeclaredInTestCase(string $methodName): bool
Parameters
  • string $methodName
Returns bool

performAssertionsOnOutput()

private function performAssertionsOnOutput(): void
Returns void
throws
Exception
throws
ExpectationFailedException
throws
NoPreviousThrowableException

requirementsNotSatisfied()

private function requirementsNotSatisfied(): bool
Returns bool

requiresXdebug()

private function requiresXdebug(): bool
Returns bool

restoreGlobalErrorExceptionHandlers()

private function restoreGlobalErrorExceptionHandlers(): void
Returns void

restoreGlobalState()

private function restoreGlobalState(): void
Returns void

runTest()

private function runTest(): mixed
Returns mixed
throws
AssertionFailedError
throws
Exception
throws
ExpectationFailedException
throws
Throwable

shouldExceptionExpectationsBeVerified()

private function shouldExceptionExpectationsBeVerified(Throwable $throwable): bool
Parameters
  • Throwable $throwable
Returns bool
throws
Exception

shouldInvocationMockerBeReset()

private function shouldInvocationMockerBeReset(\PHPUnit\Framework\MockObject\MockObject $mock): bool
Parameters
  • \PHPUnit\Framework\MockObject\MockObject $mock
Returns bool

shouldRunInSeparateProcess()

private function shouldRunInSeparateProcess(): bool
Returns bool

snapshotGlobalErrorExceptionHandlers()

private function snapshotGlobalErrorExceptionHandlers(): void
Returns void

snapshotGlobalState()

private function snapshotGlobalState(): void
Returns void

startOutputBuffering()

private function startOutputBuffering(): void
Returns void

stopOutputBuffering()

private function stopOutputBuffering(): bool
Returns bool

unregisterCustomComparators()

private function unregisterCustomComparators(): void
Returns void

verifyDeprecationExpectations()

private function verifyDeprecationExpectations(): void
Returns void
throws
ExpectationFailedException

verifyExceptionExpectations()

private function verifyExceptionExpectations(Exception|Throwable $exception): void
Parameters
  • Exception|Throwable $exception
Returns void
throws
ExpectationFailedException

verifyMockObjects()

private function verifyMockObjects(): void
Returns void
throws
Throwable

Inherited methods #