TestCase
extends TestCase
in package
Table of Contents
Constants
- LOCALE_CATEGORIES = [\LC_ALL, \LC_COLLATE, \LC_CTYPE, \LC_MONETARY, \LC_NUMERIC, \LC_TIME]
Properties
- $backupGlobals : bool|null
- $backupGlobalsBlacklist : array<string|int, string>
- $backupGlobalsExcludeList : array<string|int, string>
- $backupStaticAttributes : bool|null
- $backupStaticAttributesBlacklist : array<string, array<int, string>>
- $backupStaticAttributesExcludeList : array<string, array<int, string>>
- $preserveGlobalState : bool
- $providedTests : array<int, ExecutionOrderDependency>
- $runTestInSeparateProcess : bool|null
- $beStrictAboutChangesToGlobalState : bool
- $count : int
- $customComparators : array<string|int, Comparator>
- $data : array<string|int, mixed>
- $dataName : int|string
- $dependencies : array<int, ExecutionOrderDependency>
- $dependencyInput : array<string|int, mixed>
- $doesNotPerformAssertions : bool
- $doubledTypes : array<string|int, string>
- $expectedException : null|string
- $expectedExceptionCode : null|int|string
- $expectedExceptionMessage : null|string
- $expectedExceptionMessageRegExp : null|string
- $groups : array<string|int, string>
- $iniSettings : array<string, string>
- $inIsolation : bool
- $locale : array<string|int, mixed>
- $mockObjectGenerator : Generator
- $mockObjects : array<string|int, MockObject>
- $name : string
- $numAssertions : int
- $output : string
- $outputBufferingActive : bool
- $outputBufferingLevel : int
- $outputCallback : mixed
- $outputExpectedRegex : string|null
- $outputExpectedString : string|null
- $outputRetrievedForAssertion : bool
- $prophet : Prophet
- $registerMockObjectsFromTestArgumentsRecursively : bool
- $result : TestResult
- $runClassInSeparateProcess : bool|null
- $snapshot : Snapshot|null
- $status : int
- $statusMessage : string
- $testResult : mixed
- $warnings : array<string|int, string>
Methods
- any() : AnyInvokedCount
- Returns a matcher that matches when the method is executed zero or more times.
- anything() : IsAnything
- arrayHasKey() : ArrayHasKey
- assertArrayHasKey() : void
- Asserts that an array has a specified key.
- assertArrayNotHasKey() : void
- Asserts that an array does not have a specified key.
- assertClassHasAttribute() : void
- Asserts that a class has a specified attribute.
- assertClassHasStaticAttribute() : void
- Asserts that a class has a specified static attribute.
- assertClassNotHasAttribute() : void
- Asserts that a class does not have a specified attribute.
- assertClassNotHasStaticAttribute() : void
- Asserts that a class does not have a specified static attribute.
- assertContains() : void
- Asserts that a haystack contains a needle.
- assertContainsEquals() : void
- assertContainsOnly() : void
- Asserts that a haystack contains only values of a given type.
- assertContainsOnlyInstancesOf() : void
- Asserts that a haystack contains only instances of a given class name.
- assertCount() : void
- Asserts the number of elements of an array, Countable or Traversable.
- assertDirectoryDoesNotExist() : void
- Asserts that a directory does not exist.
- assertDirectoryExists() : void
- Asserts that a directory exists.
- assertDirectoryIsNotReadable() : void
- Asserts that a directory exists and is not readable.
- assertDirectoryIsNotWritable() : void
- Asserts that a directory exists and is not writable.
- assertDirectoryIsReadable() : void
- Asserts that a directory exists and is readable.
- assertDirectoryIsWritable() : void
- Asserts that a directory exists and is writable.
- assertDirectoryNotExists() : void
- Asserts that a directory does not exist.
- assertDirectoryNotIsReadable() : void
- Asserts that a directory exists and is not readable.
- assertDirectoryNotIsWritable() : void
- Asserts that a directory exists and is not writable.
- assertDoesNotMatchRegularExpression() : void
- Asserts that a string does not match a given regular expression.
- assertEmpty() : void
- Asserts that a variable is empty.
- assertEquals() : void
- Asserts that two variables are equal.
- assertEqualsCanonicalizing() : void
- Asserts that two variables are equal (canonicalizing).
- assertEqualsIgnoringCase() : void
- Asserts that two variables are equal (ignoring case).
- assertEqualsWithDelta() : void
- Asserts that two variables are equal (with delta).
- assertEqualXMLStructure() : void
- Asserts that a hierarchy of DOMElements matches.
- assertFalse() : void
- Asserts that a condition is false.
- assertFileDoesNotExist() : void
- Asserts that a file does not exist.
- assertFileEquals() : void
- Asserts that the contents of one file is equal to the contents of another file.
- assertFileEqualsCanonicalizing() : void
- Asserts that the contents of one file is equal to the contents of another file (canonicalizing).
- assertFileEqualsIgnoringCase() : void
- Asserts that the contents of one file is equal to the contents of another file (ignoring case).
- assertFileExists() : void
- Asserts that a file exists.
- assertFileIsNotReadable() : void
- Asserts that a file exists and is not readable.
- assertFileIsNotWritable() : void
- Asserts that a file exists and is not writable.
- assertFileIsReadable() : void
- Asserts that a file exists and is readable.
- assertFileIsWritable() : void
- Asserts that a file exists and is writable.
- assertFileNotEquals() : void
- Asserts that the contents of one file is not equal to the contents of another file.
- assertFileNotEqualsCanonicalizing() : void
- Asserts that the contents of one file is not equal to the contents of another file (canonicalizing).
- assertFileNotEqualsIgnoringCase() : void
- Asserts that the contents of one file is not equal to the contents of another file (ignoring case).
- assertFileNotExists() : void
- Asserts that a file does not exist.
- assertFileNotIsReadable() : void
- Asserts that a file exists and is not readable.
- assertFileNotIsWritable() : void
- Asserts that a file exists and is not writable.
- assertFinite() : void
- Asserts that a variable is finite.
- assertGreaterThan() : void
- Asserts that a value is greater than another value.
- assertGreaterThanOrEqual() : void
- Asserts that a value is greater than or equal to another value.
- assertInfinite() : void
- Asserts that a variable is infinite.
- assertInstanceOf() : void
- Asserts that a variable is of a given type.
- assertIsArray() : void
- Asserts that a variable is of type array.
- assertIsBool() : void
- Asserts that a variable is of type bool.
- assertIsCallable() : void
- Asserts that a variable is of type callable.
- assertIsClosedResource() : void
- Asserts that a variable is of type resource and is closed.
- assertIsFloat() : void
- Asserts that a variable is of type float.
- assertIsInt() : void
- Asserts that a variable is of type int.
- assertIsIterable() : void
- Asserts that a variable is of type iterable.
- assertIsNotArray() : void
- Asserts that a variable is not of type array.
- assertIsNotBool() : void
- Asserts that a variable is not of type bool.
- assertIsNotCallable() : void
- Asserts that a variable is not of type callable.
- assertIsNotClosedResource() : void
- Asserts that a variable is not of type resource.
- assertIsNotFloat() : void
- Asserts that a variable is not of type float.
- assertIsNotInt() : void
- Asserts that a variable is not of type int.
- assertIsNotIterable() : void
- Asserts that a variable is not of type iterable.
- assertIsNotNumeric() : void
- Asserts that a variable is not of type numeric.
- assertIsNotObject() : void
- Asserts that a variable is not of type object.
- assertIsNotReadable() : void
- Asserts that a file/dir exists and is not readable.
- assertIsNotResource() : void
- Asserts that a variable is not of type resource.
- assertIsNotScalar() : void
- Asserts that a variable is not of type scalar.
- assertIsNotString() : void
- Asserts that a variable is not of type string.
- assertIsNotWritable() : void
- Asserts that a file/dir exists and is not writable.
- assertIsNumeric() : void
- Asserts that a variable is of type numeric.
- assertIsObject() : void
- Asserts that a variable is of type object.
- assertIsReadable() : void
- Asserts that a file/dir is readable.
- assertIsResource() : void
- Asserts that a variable is of type resource.
- assertIsScalar() : void
- Asserts that a variable is of type scalar.
- assertIsString() : void
- Asserts that a variable is of type string.
- assertIsWritable() : void
- Asserts that a file/dir exists and is writable.
- assertJson() : void
- Asserts that a string is a valid JSON string.
- assertJsonFileEqualsJsonFile() : void
- Asserts that two JSON files are equal.
- assertJsonFileNotEqualsJsonFile() : void
- Asserts that two JSON files are not equal.
- assertJsonStringEqualsJsonFile() : void
- Asserts that the generated JSON encoded object and the content of the given file are equal.
- assertJsonStringEqualsJsonString() : void
- Asserts that two given JSON encoded objects or arrays are equal.
- assertJsonStringNotEqualsJsonFile() : void
- Asserts that the generated JSON encoded object and the content of the given file are not equal.
- assertJsonStringNotEqualsJsonString() : void
- Asserts that two given JSON encoded objects or arrays are not equal.
- assertLessThan() : void
- Asserts that a value is smaller than another value.
- assertLessThanOrEqual() : void
- Asserts that a value is smaller than or equal to another value.
- assertMatchesRegularExpression() : void
- Asserts that a string matches a given regular expression.
- assertNan() : void
- Asserts that a variable is nan.
- assertNotContains() : void
- Asserts that a haystack does not contain a needle.
- assertNotContainsEquals() : void
- assertNotContainsOnly() : void
- Asserts that a haystack does not contain only values of a given type.
- assertNotCount() : void
- Asserts the number of elements of an array, Countable or Traversable.
- assertNotEmpty() : void
- Asserts that a variable is not empty.
- assertNotEquals() : void
- Asserts that two variables are not equal.
- assertNotEqualsCanonicalizing() : void
- Asserts that two variables are not equal (canonicalizing).
- assertNotEqualsIgnoringCase() : void
- Asserts that two variables are not equal (ignoring case).
- assertNotEqualsWithDelta() : void
- Asserts that two variables are not equal (with delta).
- assertNotFalse() : void
- Asserts that a condition is not false.
- assertNotInstanceOf() : void
- Asserts that a variable is not of a given type.
- assertNotIsReadable() : void
- Asserts that a file/dir exists and is not readable.
- assertNotIsWritable() : void
- Asserts that a file/dir exists and is not writable.
- assertNotNull() : void
- Asserts that a variable is not null.
- assertNotRegExp() : void
- Asserts that a string does not match a given regular expression.
- assertNotSame() : void
- Asserts that two variables do not have the same type and value.
- assertNotSameSize() : void
- Assert that the size of two arrays (or `Countable` or `Traversable` objects) is not the same.
- assertNotTrue() : void
- Asserts that a condition is not true.
- assertNull() : void
- Asserts that a variable is null.
- assertObjectEquals() : void
- assertObjectHasAttribute() : void
- Asserts that an object has a specified attribute.
- assertObjectHasProperty() : void
- Asserts that an object has a specified property.
- assertObjectNotHasAttribute() : void
- Asserts that an object does not have a specified attribute.
- assertObjectNotHasProperty() : void
- Asserts that an object does not have a specified property.
- assertRegExp() : void
- Asserts that a string matches a given regular expression.
- assertSame() : void
- Asserts that two variables have the same type and value.
- assertSameSize() : void
- Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same.
- assertStringContainsString() : void
- assertStringContainsStringIgnoringCase() : void
- assertStringEndsNotWith() : void
- Asserts that a string ends not with a given suffix.
- assertStringEndsWith() : void
- Asserts that a string ends with a given suffix.
- assertStringEqualsFile() : void
- Asserts that the contents of a string is equal to the contents of a file.
- assertStringEqualsFileCanonicalizing() : void
- Asserts that the contents of a string is equal to the contents of a file (canonicalizing).
- assertStringEqualsFileIgnoringCase() : void
- Asserts that the contents of a string is equal to the contents of a file (ignoring case).
- assertStringMatchesFormat() : void
- Asserts that a string matches a given format string.
- assertStringMatchesFormatFile() : void
- Asserts that a string matches a given format file.
- assertStringNotContainsString() : void
- assertStringNotContainsStringIgnoringCase() : void
- assertStringNotEqualsFile() : void
- Asserts that the contents of a string is not equal to the contents of a file.
- assertStringNotEqualsFileCanonicalizing() : void
- Asserts that the contents of a string is not equal to the contents of a file (canonicalizing).
- assertStringNotEqualsFileIgnoringCase() : void
- Asserts that the contents of a string is not equal to the contents of a file (ignoring case).
- assertStringNotMatchesFormat() : void
- Asserts that a string does not match a given format string.
- assertStringNotMatchesFormatFile() : void
- Asserts that a string does not match a given format string.
- assertStringStartsNotWith() : void
- Asserts that a string starts not with a given prefix.
- assertStringStartsWith() : void
- Asserts that a string starts with a given prefix.
- assertThat() : void
- Evaluates a PHPUnit\Framework\Constraint matcher object.
- assertTrue() : void
- Asserts that a condition is true.
- assertXmlFileEqualsXmlFile() : void
- Asserts that two XML files are equal.
- assertXmlFileNotEqualsXmlFile() : void
- Asserts that two XML files are not equal.
- assertXmlStringEqualsXmlFile() : void
- Asserts that two XML documents are equal.
- assertXmlStringEqualsXmlString() : void
- Asserts that two XML documents are equal.
- assertXmlStringNotEqualsXmlFile() : void
- Asserts that two XML documents are not equal.
- assertXmlStringNotEqualsXmlString() : void
- Asserts that two XML documents are not equal.
- at() : InvokedAtIndex
- Returns a matcher that matches when the method is executed at the given index.
- atLeast() : InvokedAtLeastCount
- Returns a matcher that matches when the method is executed at least N times.
- atLeastOnce() : InvokedAtLeastOnce
- Returns a matcher that matches when the method is executed at least once.
- atMost() : InvokedAtMostCount
- Returns a matcher that matches when the method is executed at most N times.
- authenticationMock() : mixed
- callback() : Callback
- classHasAttribute() : ClassHasAttribute
- classHasStaticAttribute() : ClassHasStaticAttribute
- containsEqual() : TraversableContainsEqual
- containsIdentical() : TraversableContainsIdentical
- containsOnly() : TraversableContainsOnly
- containsOnlyInstancesOf() : TraversableContainsOnly
- count() : int
- countOf() : Count
- directoryExists() : DirectoryExists
- equalTo() : IsEqual
- equalToCanonicalizing() : IsEqualCanonicalizing
- equalToIgnoringCase() : IsEqualIgnoringCase
- equalToWithDelta() : IsEqualWithDelta
- exactly() : InvokedCount
- Returns a matcher that matches when the method is executed exactly $count times.
- expectDeprecation() : void
- expectDeprecationMessage() : void
- expectDeprecationMessageMatches() : void
- expectError() : void
- expectErrorMessage() : void
- expectErrorMessageMatches() : void
- expectException() : void
- expectExceptionCode() : void
- expectExceptionMessage() : void
- expectExceptionMessageMatches() : void
- expectExceptionObject() : void
- Sets up an expectation for an exception to be raised by the code under test.
- expectNotice() : void
- expectNoticeMessage() : void
- expectNoticeMessageMatches() : void
- expectNotToPerformAssertions() : void
- expectOutputRegex() : void
- expectOutputString() : void
- expectWarning() : void
- expectWarningMessage() : void
- expectWarningMessageMatches() : void
- fail() : void
- Fails a test with the given message.
- fileExists() : FileExists
- getActualOutputForAssertion() : string
- getCount() : int
- Return the current assertion count.
- getMockBuilder() : MockBuilder
- Returns a builder object to create mock objects using a fluent interface.
- getStatus() : int
- getStatusMessage() : string
- greaterThan() : GreaterThan
- greaterThanOrEqual() : LogicalOr
- hasFailed() : bool
- identicalTo() : IsIdentical
- isEmpty() : IsEmpty
- isFalse() : IsFalse
- isFinite() : IsFinite
- isInfinite() : IsInfinite
- isInstanceOf() : IsInstanceOf
- isJson() : IsJson
- isNan() : IsNan
- isNull() : IsNull
- isReadable() : IsReadable
- isTrue() : IsTrue
- isType() : IsType
- isWritable() : IsWritable
- lessThan() : LessThan
- lessThanOrEqual() : LogicalOr
- logicalAnd() : LogicalAnd
- logicalNot() : LogicalNot
- logicalOr() : LogicalOr
- logicalXor() : LogicalXor
- logoutMock() : mixed
- markAsRisky() : void
- markTestIncomplete() : void
- Mark the test as incomplete.
- markTestSkipped() : void
- Mark the test as skipped.
- matches() : StringMatchesFormatDescription
- matchesRegularExpression() : RegularExpression
- never() : InvokedCount
- Returns a matcher that matches when the method is never executed.
- objectEquals() : ObjectEquals
- objectHasAttribute() : ObjectHasAttribute
- once() : InvokedCount
- Returns a matcher that matches when the method is executed exactly once.
- onConsecutiveCalls() : ConsecutiveCalls
- presenceSubscriptionMock() : mixed
- provides() : array<int, ExecutionOrderDependency>
- Returns the normalized test name as class::method.
- refreshMock() : mixed
- registerComparator() : void
- requires() : array<int, ExecutionOrderDependency>
- Returns a list of normalized dependency names, class::method.
- resetCount() : void
- Reset the assertion counter.
- returnArgument() : ReturnArgument
- returnCallback() : ReturnCallback
- returnSelf() : ReturnSelf
- Returns the current object.
- returnValue() : ReturnStub
- returnValueMap() : ReturnValueMap
- run() : TestResult
- Runs the test case and collects the results in a TestResult object.
- setUpBeforeClass() : void
- This method is called before the first test of this test class is run.
- sortId() : string
- stringContains() : StringContains
- stringEndsWith() : StringEndsWith
- stringStartsWith() : StringStartsWith
- subscriptionMock() : mixed
- tearDownAfterClass() : void
- This method is called after the last test of this test class is run.
- throwException() : Exception
- toString() : string
- Returns a string representation of the test case.
- assertPostConditions() : void
- Performs assertions shared by all tests of a test case.
- assertPreConditions() : void
- Performs assertions shared by all tests of a test case.
- createConfiguredMock() : MockObject
- Returns a configured mock object for the specified class.
- createGuzzle() : mixed
- createMock() : MockObject
- Returns a mock object for the specified class.
- createPartialMock() : MockObject
- Returns a partial mock object for the specified class.
- createResponse() : mixed
- createStub() : Stub
- Makes configurable stub for the specified class.
- createTestProxy() : MockObject
- Returns a test proxy for the specified class.
- getMockClass() : string
- Mocks the specified class and returns the name of the mocked class.
- getMockForAbstractClass() : MockObject
- Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default.
- getMockForTrait() : MockObject
- Returns 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() : MockObject
- Returns a mock object based on the given WSDL file.
- getObjectForTrait() : object
- Returns an object for the specified trait.
- getSDK() : mixed
- iniSet() : 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.
- onNotSuccessfulTest() : void
- This method is called when a test method did not execute successfully.
- prophesize() : ObjectProphecy
- recordDoubledType() : void
- runTest() : mixed
- Override to run the test and assert its state.
- setLocale() : void
- This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.
- setUp() : void
- This method is called before each test.
- tearDown() : void
- This method is called after each test.
- checkExceptionExpectations() : bool
- checkRequirements() : void
- cleanupIniSettings() : void
- cleanupLocaleSettings() : void
- compareGlobalStateSnapshotPart() : void
- compareGlobalStateSnapshots() : void
- createGlobalStateSnapshot() : Snapshot
- createMockObject() : MockObject
- createWarning() : void
- detectLocationHint() : array<string|int, mixed>|null
- getMockObjectGenerator() : Generator
- Get the mock object generator, creating it if it doesn't exist.
- getProphet() : Prophet
- handleDependencies() : bool
- isCallableTestMethod() : bool
- isValidClassAttributeName() : bool
- isValidObjectAttributeName() : bool
- markSkippedForMissingDependency() : void
- markSkippedForNotSpecifyingDependency() : void
- markWarningForUncallableDependency() : void
- registerMockObjectsFromTestArguments() : void
- restoreGlobalState() : void
- runInSeparateProcess() : bool
- setDoesNotPerformAssertionsFromAnnotation() : void
- shouldInvocationMockerBeReset() : bool
- snapshotGlobalState() : void
- startOutputBuffering() : void
- stopOutputBuffering() : void
- unregisterCustomComparators() : void
- verifyMockObjects() : void
Constants
LOCALE_CATEGORIES
private
mixed
LOCALE_CATEGORIES
= [\LC_ALL, \LC_COLLATE, \LC_CTYPE, \LC_MONETARY, \LC_NUMERIC, \LC_TIME]
Properties
$backupGlobals
protected
bool|null
$backupGlobals
$backupGlobalsBlacklist
Use $backupGlobalsExcludeList instead
protected
array<string|int, string>
$backupGlobalsBlacklist
= []
$backupGlobalsExcludeList
protected
array<string|int, string>
$backupGlobalsExcludeList
= []
$backupStaticAttributes
protected
bool|null
$backupStaticAttributes
$backupStaticAttributesBlacklist
Use $backupStaticAttributesExcludeList instead
protected
array<string, array<int, string>>
$backupStaticAttributesBlacklist
= []
$backupStaticAttributesExcludeList
protected
array<string, array<int, string>>
$backupStaticAttributesExcludeList
= []
$preserveGlobalState
protected
bool
$preserveGlobalState
= true
$providedTests
protected
array<int, ExecutionOrderDependency>
$providedTests
= []
$runTestInSeparateProcess
protected
bool|null
$runTestInSeparateProcess
$beStrictAboutChangesToGlobalState
private
bool
$beStrictAboutChangesToGlobalState
= false
$count
private
static int
$count
= 0
$customComparators
private
array<string|int, Comparator>
$customComparators
= []
$data
private
array<string|int, mixed>
$data
$dataName
private
int|string
$dataName
$dependencies
private
array<int, ExecutionOrderDependency>
$dependencies
= []
$dependencyInput
private
array<string|int, mixed>
$dependencyInput
= []
$doesNotPerformAssertions
private
bool
$doesNotPerformAssertions
= false
$doubledTypes
private
array<string|int, string>
$doubledTypes
= []
$expectedException
private
null|string
$expectedException
$expectedExceptionCode
private
null|int|string
$expectedExceptionCode
$expectedExceptionMessage
private
null|string
$expectedExceptionMessage
$expectedExceptionMessageRegExp
private
null|string
$expectedExceptionMessageRegExp
$groups
private
array<string|int, string>
$groups
= []
$iniSettings
private
array<string, string>
$iniSettings
= []
$inIsolation
private
bool
$inIsolation
= false
$locale
private
array<string|int, mixed>
$locale
= []
$mockObjectGenerator
private
Generator
$mockObjectGenerator
$mockObjects
private
array<string|int, MockObject>
$mockObjects
= []
$name
private
string
$name
= ''
$numAssertions
private
int
$numAssertions
= 0
$output
private
string
$output
= ''
$outputBufferingActive
private
bool
$outputBufferingActive
= false
$outputBufferingLevel
private
int
$outputBufferingLevel
$outputCallback
private
mixed
$outputCallback
= false
$outputExpectedRegex
private
string|null
$outputExpectedRegex
$outputExpectedString
private
string|null
$outputExpectedString
$outputRetrievedForAssertion
private
bool
$outputRetrievedForAssertion
= false
$prophet
private
Prophet
$prophet
$registerMockObjectsFromTestArgumentsRecursively
private
bool
$registerMockObjectsFromTestArgumentsRecursively
= false
$result
private
TestResult
$result
$runClassInSeparateProcess
private
bool|null
$runClassInSeparateProcess
$snapshot
private
Snapshot|null
$snapshot
$status
private
int
$status
= \PHPUnit\Runner\BaseTestRunner::STATUS_UNKNOWN
$statusMessage
private
string
$statusMessage
= ''
$testResult
private
mixed
$testResult
$warnings
private
array<string|int, string>
$warnings
= []
Methods
any()
Returns a matcher that matches when the method is executed zero or more times.
public
static any() : AnyInvokedCount
Return values
AnyInvokedCountanything()
public
static anything() : IsAnything
Return values
IsAnythingarrayHasKey()
public
static arrayHasKey(int|string $key) : ArrayHasKey
Parameters
- $key : int|string
Return values
ArrayHasKeyassertArrayHasKey()
Asserts that an array has a specified key.
public
static assertArrayHasKey(int|string $key, array<string|int, mixed>|ArrayAccess $array[, string $message = '' ]) : void
Parameters
- $key : int|string
- $array : array<string|int, mixed>|ArrayAccess
- $message : string = ''
Tags
assertArrayNotHasKey()
Asserts that an array does not have a specified key.
public
static assertArrayNotHasKey(int|string $key, array<string|int, mixed>|ArrayAccess $array[, string $message = '' ]) : void
Parameters
- $key : int|string
- $array : array<string|int, mixed>|ArrayAccess
- $message : string = ''
Tags
assertClassHasAttribute()
Asserts that a class has a specified attribute.
public
static assertClassHasAttribute(string $attributeName, string $className[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4601
Parameters
- $attributeName : string
- $className : string
- $message : string = ''
Tags
assertClassHasStaticAttribute()
Asserts that a class has a specified static attribute.
public
static assertClassHasStaticAttribute(string $attributeName, string $className[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4601
Parameters
- $attributeName : string
- $className : string
- $message : string = ''
Tags
assertClassNotHasAttribute()
Asserts that a class does not have a specified attribute.
public
static assertClassNotHasAttribute(string $attributeName, string $className[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4601
Parameters
- $attributeName : string
- $className : string
- $message : string = ''
Tags
assertClassNotHasStaticAttribute()
Asserts that a class does not have a specified static attribute.
public
static assertClassNotHasStaticAttribute(string $attributeName, string $className[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4601
Parameters
- $attributeName : string
- $className : string
- $message : string = ''
Tags
assertContains()
Asserts that a haystack contains a needle.
public
static assertContains(mixed $needle, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $needle : mixed
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsEquals()
public
static assertContainsEquals(mixed $needle, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $needle : mixed
- $haystack : iterable<string|int, mixed>
- $message : string = ''
assertContainsOnly()
Asserts that a haystack contains only values of a given type.
public
static assertContainsOnly(string $type, iterable<string|int, mixed> $haystack[, bool|null $isNativeType = null ][, string $message = '' ]) : void
Parameters
- $type : string
- $haystack : iterable<string|int, mixed>
- $isNativeType : bool|null = null
- $message : string = ''
Tags
assertContainsOnlyInstancesOf()
Asserts that a haystack contains only instances of a given class name.
public
static assertContainsOnlyInstancesOf(string $className, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $className : string
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertCount()
Asserts the number of elements of an array, Countable or Traversable.
public
static assertCount(int $expectedCount, Countable|iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $expectedCount : int
- $haystack : Countable|iterable<string|int, mixed>
- $message : string = ''
Tags
assertDirectoryDoesNotExist()
Asserts that a directory does not exist.
public
static assertDirectoryDoesNotExist(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryExists()
Asserts that a directory exists.
public
static assertDirectoryExists(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryIsNotReadable()
Asserts that a directory exists and is not readable.
public
static assertDirectoryIsNotReadable(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryIsNotWritable()
Asserts that a directory exists and is not writable.
public
static assertDirectoryIsNotWritable(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryIsReadable()
Asserts that a directory exists and is readable.
public
static assertDirectoryIsReadable(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryIsWritable()
Asserts that a directory exists and is writable.
public
static assertDirectoryIsWritable(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryNotExists()
Asserts that a directory does not exist.
public
static assertDirectoryNotExists(string $directory[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4068
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryNotIsReadable()
Asserts that a directory exists and is not readable.
public
static assertDirectoryNotIsReadable(string $directory[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4071
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryNotIsWritable()
Asserts that a directory exists and is not writable.
public
static assertDirectoryNotIsWritable(string $directory[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4074
Parameters
- $directory : string
- $message : string = ''
Tags
assertDoesNotMatchRegularExpression()
Asserts that a string does not match a given regular expression.
public
static assertDoesNotMatchRegularExpression(string $pattern, string $string[, string $message = '' ]) : void
Parameters
- $pattern : string
- $string : string
- $message : string = ''
Tags
assertEmpty()
Asserts that a variable is empty.
public
static assertEmpty(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertEquals()
Asserts that two variables are equal.
public
static assertEquals(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertEqualsCanonicalizing()
Asserts that two variables are equal (canonicalizing).
public
static assertEqualsCanonicalizing(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertEqualsIgnoringCase()
Asserts that two variables are equal (ignoring case).
public
static assertEqualsIgnoringCase(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertEqualsWithDelta()
Asserts that two variables are equal (with delta).
public
static assertEqualsWithDelta(mixed $expected, mixed $actual, float $delta[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $delta : float
- $message : string = ''
Tags
assertEqualXMLStructure()
Asserts that a hierarchy of DOMElements matches.
public
static assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement[, bool $checkAttributes = false ][, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4091
Parameters
- $expectedElement : DOMElement
- $actualElement : DOMElement
- $checkAttributes : bool = false
- $message : string = ''
Tags
assertFalse()
Asserts that a condition is false.
public
static assertFalse(mixed $condition[, string $message = '' ]) : void
Parameters
- $condition : mixed
- $message : string = ''
Tags
assertFileDoesNotExist()
Asserts that a file does not exist.
public
static assertFileDoesNotExist(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertFileEquals()
Asserts that the contents of one file is equal to the contents of another file.
public
static assertFileEquals(string $expected, string $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : string
- $message : string = ''
Tags
assertFileEqualsCanonicalizing()
Asserts that the contents of one file is equal to the contents of another file (canonicalizing).
public
static assertFileEqualsCanonicalizing(string $expected, string $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : string
- $message : string = ''
Tags
assertFileEqualsIgnoringCase()
Asserts that the contents of one file is equal to the contents of another file (ignoring case).
public
static assertFileEqualsIgnoringCase(string $expected, string $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : string
- $message : string = ''
Tags
assertFileExists()
Asserts that a file exists.
public
static assertFileExists(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertFileIsNotReadable()
Asserts that a file exists and is not readable.
public
static assertFileIsNotReadable(string $file[, string $message = '' ]) : void
Parameters
- $file : string
- $message : string = ''
Tags
assertFileIsNotWritable()
Asserts that a file exists and is not writable.
public
static assertFileIsNotWritable(string $file[, string $message = '' ]) : void
Parameters
- $file : string
- $message : string = ''
Tags
assertFileIsReadable()
Asserts that a file exists and is readable.
public
static assertFileIsReadable(string $file[, string $message = '' ]) : void
Parameters
- $file : string
- $message : string = ''
Tags
assertFileIsWritable()
Asserts that a file exists and is writable.
public
static assertFileIsWritable(string $file[, string $message = '' ]) : void
Parameters
- $file : string
- $message : string = ''
Tags
assertFileNotEquals()
Asserts that the contents of one file is not equal to the contents of another file.
public
static assertFileNotEquals(string $expected, string $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : string
- $message : string = ''
Tags
assertFileNotEqualsCanonicalizing()
Asserts that the contents of one file is not equal to the contents of another file (canonicalizing).
public
static assertFileNotEqualsCanonicalizing(string $expected, string $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : string
- $message : string = ''
Tags
assertFileNotEqualsIgnoringCase()
Asserts that the contents of one file is not equal to the contents of another file (ignoring case).
public
static assertFileNotEqualsIgnoringCase(string $expected, string $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : string
- $message : string = ''
Tags
assertFileNotExists()
Asserts that a file does not exist.
public
static assertFileNotExists(string $filename[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4077
Parameters
- $filename : string
- $message : string = ''
Tags
assertFileNotIsReadable()
Asserts that a file exists and is not readable.
public
static assertFileNotIsReadable(string $file[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4080
Parameters
- $file : string
- $message : string = ''
Tags
assertFileNotIsWritable()
Asserts that a file exists and is not writable.
public
static assertFileNotIsWritable(string $file[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4083
Parameters
- $file : string
- $message : string = ''
Tags
assertFinite()
Asserts that a variable is finite.
public
static assertFinite(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertGreaterThan()
Asserts that a value is greater than another value.
public
static assertGreaterThan(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertGreaterThanOrEqual()
Asserts that a value is greater than or equal to another value.
public
static assertGreaterThanOrEqual(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertInfinite()
Asserts that a variable is infinite.
public
static assertInfinite(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertInstanceOf()
Asserts that a variable is of a given type.
public
static assertInstanceOf(string $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : mixed
- $message : string = ''
Tags
assertIsArray()
Asserts that a variable is of type array.
public
static assertIsArray(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsBool()
Asserts that a variable is of type bool.
public
static assertIsBool(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsCallable()
Asserts that a variable is of type callable.
public
static assertIsCallable(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsClosedResource()
Asserts that a variable is of type resource and is closed.
public
static assertIsClosedResource(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsFloat()
Asserts that a variable is of type float.
public
static assertIsFloat(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsInt()
Asserts that a variable is of type int.
public
static assertIsInt(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsIterable()
Asserts that a variable is of type iterable.
public
static assertIsIterable(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotArray()
Asserts that a variable is not of type array.
public
static assertIsNotArray(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotBool()
Asserts that a variable is not of type bool.
public
static assertIsNotBool(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotCallable()
Asserts that a variable is not of type callable.
public
static assertIsNotCallable(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotClosedResource()
Asserts that a variable is not of type resource.
public
static assertIsNotClosedResource(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotFloat()
Asserts that a variable is not of type float.
public
static assertIsNotFloat(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotInt()
Asserts that a variable is not of type int.
public
static assertIsNotInt(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotIterable()
Asserts that a variable is not of type iterable.
public
static assertIsNotIterable(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotNumeric()
Asserts that a variable is not of type numeric.
public
static assertIsNotNumeric(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotObject()
Asserts that a variable is not of type object.
public
static assertIsNotObject(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotReadable()
Asserts that a file/dir exists and is not readable.
public
static assertIsNotReadable(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertIsNotResource()
Asserts that a variable is not of type resource.
public
static assertIsNotResource(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotScalar()
Asserts that a variable is not of type scalar.
public
static assertIsNotScalar(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotString()
Asserts that a variable is not of type string.
public
static assertIsNotString(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotWritable()
Asserts that a file/dir exists and is not writable.
public
static assertIsNotWritable(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertIsNumeric()
Asserts that a variable is of type numeric.
public
static assertIsNumeric(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsObject()
Asserts that a variable is of type object.
public
static assertIsObject(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsReadable()
Asserts that a file/dir is readable.
public
static assertIsReadable(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertIsResource()
Asserts that a variable is of type resource.
public
static assertIsResource(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsScalar()
Asserts that a variable is of type scalar.
public
static assertIsScalar(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsString()
Asserts that a variable is of type string.
public
static assertIsString(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsWritable()
Asserts that a file/dir exists and is writable.
public
static assertIsWritable(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertJson()
Asserts that a string is a valid JSON string.
public
static assertJson(string $actualJson[, string $message = '' ]) : void
Parameters
- $actualJson : string
- $message : string = ''
Tags
assertJsonFileEqualsJsonFile()
Asserts that two JSON files are equal.
public
static assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualFile : string
- $message : string = ''
Tags
assertJsonFileNotEqualsJsonFile()
Asserts that two JSON files are not equal.
public
static assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualFile : string
- $message : string = ''
Tags
assertJsonStringEqualsJsonFile()
Asserts that the generated JSON encoded object and the content of the given file are equal.
public
static assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualJson : string
- $message : string = ''
Tags
assertJsonStringEqualsJsonString()
Asserts that two given JSON encoded objects or arrays are equal.
public
static assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson[, string $message = '' ]) : void
Parameters
- $expectedJson : string
- $actualJson : string
- $message : string = ''
Tags
assertJsonStringNotEqualsJsonFile()
Asserts that the generated JSON encoded object and the content of the given file are not equal.
public
static assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualJson : string
- $message : string = ''
Tags
assertJsonStringNotEqualsJsonString()
Asserts that two given JSON encoded objects or arrays are not equal.
public
static assertJsonStringNotEqualsJsonString(string $expectedJson, string $actualJson[, string $message = '' ]) : void
Parameters
- $expectedJson : string
- $actualJson : string
- $message : string = ''
Tags
assertLessThan()
Asserts that a value is smaller than another value.
public
static assertLessThan(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertLessThanOrEqual()
Asserts that a value is smaller than or equal to another value.
public
static assertLessThanOrEqual(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertMatchesRegularExpression()
Asserts that a string matches a given regular expression.
public
static assertMatchesRegularExpression(string $pattern, string $string[, string $message = '' ]) : void
Parameters
- $pattern : string
- $string : string
- $message : string = ''
Tags
assertNan()
Asserts that a variable is nan.
public
static assertNan(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertNotContains()
Asserts that a haystack does not contain a needle.
public
static assertNotContains(mixed $needle, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $needle : mixed
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertNotContainsEquals()
public
static assertNotContainsEquals(mixed $needle, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $needle : mixed
- $haystack : iterable<string|int, mixed>
- $message : string = ''
assertNotContainsOnly()
Asserts that a haystack does not contain only values of a given type.
public
static assertNotContainsOnly(string $type, iterable<string|int, mixed> $haystack[, bool|null $isNativeType = null ][, string $message = '' ]) : void
Parameters
- $type : string
- $haystack : iterable<string|int, mixed>
- $isNativeType : bool|null = null
- $message : string = ''
Tags
assertNotCount()
Asserts the number of elements of an array, Countable or Traversable.
public
static assertNotCount(int $expectedCount, Countable|iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $expectedCount : int
- $haystack : Countable|iterable<string|int, mixed>
- $message : string = ''
Tags
assertNotEmpty()
Asserts that a variable is not empty.
public
static assertNotEmpty(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertNotEquals()
Asserts that two variables are not equal.
public
static assertNotEquals(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertNotEqualsCanonicalizing()
Asserts that two variables are not equal (canonicalizing).
public
static assertNotEqualsCanonicalizing(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertNotEqualsIgnoringCase()
Asserts that two variables are not equal (ignoring case).
public
static assertNotEqualsIgnoringCase(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertNotEqualsWithDelta()
Asserts that two variables are not equal (with delta).
public
static assertNotEqualsWithDelta(mixed $expected, mixed $actual, float $delta[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $delta : float
- $message : string = ''
Tags
assertNotFalse()
Asserts that a condition is not false.
public
static assertNotFalse(mixed $condition[, string $message = '' ]) : void
Parameters
- $condition : mixed
- $message : string = ''
Tags
assertNotInstanceOf()
Asserts that a variable is not of a given type.
public
static assertNotInstanceOf(string $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : mixed
- $message : string = ''
Tags
assertNotIsReadable()
Asserts that a file/dir exists and is not readable.
public
static assertNotIsReadable(string $filename[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4062
Parameters
- $filename : string
- $message : string = ''
Tags
assertNotIsWritable()
Asserts that a file/dir exists and is not writable.
public
static assertNotIsWritable(string $filename[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4065
Parameters
- $filename : string
- $message : string = ''
Tags
assertNotNull()
Asserts that a variable is not null.
public
static assertNotNull(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertNotRegExp()
Asserts that a string does not match a given regular expression.
public
static assertNotRegExp(string $pattern, string $string[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4089
Parameters
- $pattern : string
- $string : string
- $message : string = ''
Tags
assertNotSame()
Asserts that two variables do not have the same type and value.
public
static assertNotSame(mixed $expected, mixed $actual[, string $message = '' ]) : void
Used on objects, it asserts that two variables do not reference the same object.
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertNotSameSize()
Assert that the size of two arrays (or `Countable` or `Traversable` objects) is not the same.
public
static assertNotSameSize(Countable|iterable<string|int, mixed> $expected, Countable|iterable<string|int, mixed> $actual[, string $message = '' ]) : void
Parameters
- $expected : Countable|iterable<string|int, mixed>
- $actual : Countable|iterable<string|int, mixed>
- $message : string = ''
Tags
assertNotTrue()
Asserts that a condition is not true.
public
static assertNotTrue(mixed $condition[, string $message = '' ]) : void
Parameters
- $condition : mixed
- $message : string = ''
Tags
assertNull()
Asserts that a variable is null.
public
static assertNull(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertObjectEquals()
public
static assertObjectEquals(object $expected, object $actual[, string $method = 'equals' ][, string $message = '' ]) : void
Parameters
- $expected : object
- $actual : object
- $method : string = 'equals'
- $message : string = ''
Tags
assertObjectHasAttribute()
Asserts that an object has a specified attribute.
public
static assertObjectHasAttribute(string $attributeName, object $object[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4601
Parameters
- $attributeName : string
- $object : object
- $message : string = ''
Tags
assertObjectHasProperty()
Asserts that an object has a specified property.
public
final static assertObjectHasProperty(string $propertyName, object $object[, string $message = '' ]) : void
Parameters
- $propertyName : string
- $object : object
- $message : string = ''
Tags
assertObjectNotHasAttribute()
Asserts that an object does not have a specified attribute.
public
static assertObjectNotHasAttribute(string $attributeName, object $object[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4601
Parameters
- $attributeName : string
- $object : object
- $message : string = ''
Tags
assertObjectNotHasProperty()
Asserts that an object does not have a specified property.
public
final static assertObjectNotHasProperty(string $propertyName, object $object[, string $message = '' ]) : void
Parameters
- $propertyName : string
- $object : object
- $message : string = ''
Tags
assertRegExp()
Asserts that a string matches a given regular expression.
public
static assertRegExp(string $pattern, string $string[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/4086
Parameters
- $pattern : string
- $string : string
- $message : string = ''
Tags
assertSame()
Asserts that two variables have the same type and value.
public
static assertSame(mixed $expected, mixed $actual[, string $message = '' ]) : void
Used on objects, it asserts that two variables reference the same object.
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertSameSize()
Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same.
public
static assertSameSize(Countable|iterable<string|int, mixed> $expected, Countable|iterable<string|int, mixed> $actual[, string $message = '' ]) : void
Parameters
- $expected : Countable|iterable<string|int, mixed>
- $actual : Countable|iterable<string|int, mixed>
- $message : string = ''
Tags
assertStringContainsString()
public
static assertStringContainsString(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
- $needle : string
- $haystack : string
- $message : string = ''
Tags
assertStringContainsStringIgnoringCase()
public
static assertStringContainsStringIgnoringCase(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
- $needle : string
- $haystack : string
- $message : string = ''
Tags
assertStringEndsNotWith()
Asserts that a string ends not with a given suffix.
public
static assertStringEndsNotWith(string $suffix, string $string[, string $message = '' ]) : void
Parameters
- $suffix : string
- $string : string
- $message : string = ''
Tags
assertStringEndsWith()
Asserts that a string ends with a given suffix.
public
static assertStringEndsWith(string $suffix, string $string[, string $message = '' ]) : void
Parameters
- $suffix : string
- $string : string
- $message : string = ''
Tags
assertStringEqualsFile()
Asserts that the contents of a string is equal to the contents of a file.
public
static assertStringEqualsFile(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualString : string
- $message : string = ''
Tags
assertStringEqualsFileCanonicalizing()
Asserts that the contents of a string is equal to the contents of a file (canonicalizing).
public
static assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualString : string
- $message : string = ''
Tags
assertStringEqualsFileIgnoringCase()
Asserts that the contents of a string is equal to the contents of a file (ignoring case).
public
static assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualString : string
- $message : string = ''
Tags
assertStringMatchesFormat()
Asserts that a string matches a given format string.
public
static assertStringMatchesFormat(string $format, string $string[, string $message = '' ]) : void
Parameters
- $format : string
- $string : string
- $message : string = ''
Tags
assertStringMatchesFormatFile()
Asserts that a string matches a given format file.
public
static assertStringMatchesFormatFile(string $formatFile, string $string[, string $message = '' ]) : void
Parameters
- $formatFile : string
- $string : string
- $message : string = ''
Tags
assertStringNotContainsString()
public
static assertStringNotContainsString(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
- $needle : string
- $haystack : string
- $message : string = ''
Tags
assertStringNotContainsStringIgnoringCase()
public
static assertStringNotContainsStringIgnoringCase(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
- $needle : string
- $haystack : string
- $message : string = ''
Tags
assertStringNotEqualsFile()
Asserts that the contents of a string is not equal to the contents of a file.
public
static assertStringNotEqualsFile(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualString : string
- $message : string = ''
Tags
assertStringNotEqualsFileCanonicalizing()
Asserts that the contents of a string is not equal to the contents of a file (canonicalizing).
public
static assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualString : string
- $message : string = ''
Tags
assertStringNotEqualsFileIgnoringCase()
Asserts that the contents of a string is not equal to the contents of a file (ignoring case).
public
static assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualString : string
- $message : string = ''
Tags
assertStringNotMatchesFormat()
Asserts that a string does not match a given format string.
public
static assertStringNotMatchesFormat(string $format, string $string[, string $message = '' ]) : void
Parameters
- $format : string
- $string : string
- $message : string = ''
Tags
assertStringNotMatchesFormatFile()
Asserts that a string does not match a given format string.
public
static assertStringNotMatchesFormatFile(string $formatFile, string $string[, string $message = '' ]) : void
Parameters
- $formatFile : string
- $string : string
- $message : string = ''
Tags
assertStringStartsNotWith()
Asserts that a string starts not with a given prefix.
public
static assertStringStartsNotWith(string $prefix, string $string[, string $message = '' ]) : void
Parameters
- $prefix : string
- $string : string
- $message : string = ''
Tags
assertStringStartsWith()
Asserts that a string starts with a given prefix.
public
static assertStringStartsWith(string $prefix, string $string[, string $message = '' ]) : void
Parameters
- $prefix : string
- $string : string
- $message : string = ''
Tags
assertThat()
Evaluates a PHPUnit\Framework\Constraint matcher object.
public
static assertThat(mixed $value, Constraint $constraint[, string $message = '' ]) : void
Parameters
- $value : mixed
- $constraint : Constraint
- $message : string = ''
Tags
assertTrue()
Asserts that a condition is true.
public
static assertTrue(mixed $condition[, string $message = '' ]) : void
Parameters
- $condition : mixed
- $message : string = ''
Tags
assertXmlFileEqualsXmlFile()
Asserts that two XML files are equal.
public
static assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualFile : string
- $message : string = ''
Tags
assertXmlFileNotEqualsXmlFile()
Asserts that two XML files are not equal.
public
static assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualFile : string
- $message : string = ''
Tags
assertXmlStringEqualsXmlFile()
Asserts that two XML documents are equal.
public
static assertXmlStringEqualsXmlFile(string $expectedFile, DOMDocument|string $actualXml[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualXml : DOMDocument|string
- $message : string = ''
Tags
assertXmlStringEqualsXmlString()
Asserts that two XML documents are equal.
public
static assertXmlStringEqualsXmlString(DOMDocument|string $expectedXml, DOMDocument|string $actualXml[, string $message = '' ]) : void
Parameters
- $expectedXml : DOMDocument|string
- $actualXml : DOMDocument|string
- $message : string = ''
Tags
assertXmlStringNotEqualsXmlFile()
Asserts that two XML documents are not equal.
public
static assertXmlStringNotEqualsXmlFile(string $expectedFile, DOMDocument|string $actualXml[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualXml : DOMDocument|string
- $message : string = ''
Tags
assertXmlStringNotEqualsXmlString()
Asserts that two XML documents are not equal.
public
static assertXmlStringNotEqualsXmlString(DOMDocument|string $expectedXml, DOMDocument|string $actualXml[, string $message = '' ]) : void
Parameters
- $expectedXml : DOMDocument|string
- $actualXml : DOMDocument|string
- $message : string = ''
Tags
at()
Returns a matcher that matches when the method is executed at the given index.
public
static at(int $index) : InvokedAtIndex
https://github.com/sebastianbergmann/phpunit/issues/4297
Parameters
- $index : int
Tags
Return values
InvokedAtIndexatLeast()
Returns a matcher that matches when the method is executed at least N times.
public
static atLeast(int $requiredInvocations) : InvokedAtLeastCount
Parameters
- $requiredInvocations : int
Return values
InvokedAtLeastCountatLeastOnce()
Returns a matcher that matches when the method is executed at least once.
public
static atLeastOnce() : InvokedAtLeastOnce
Return values
InvokedAtLeastOnceatMost()
Returns a matcher that matches when the method is executed at most N times.
public
static atMost(int $allowedInvocations) : InvokedAtMostCount
Parameters
- $allowedInvocations : int
Return values
InvokedAtMostCountauthenticationMock()
public
authenticationMock() : mixed
callback()
public
static callback(callable $callback) : Callback
Parameters
- $callback : callable
Tags
Return values
CallbackclassHasAttribute()
public
static classHasAttribute(string $attributeName) : ClassHasAttribute
https://github.com/sebastianbergmann/phpunit/issues/4601
Parameters
- $attributeName : string
Return values
ClassHasAttributeclassHasStaticAttribute()
public
static classHasStaticAttribute(string $attributeName) : ClassHasStaticAttribute
https://github.com/sebastianbergmann/phpunit/issues/4601
Parameters
- $attributeName : string
Return values
ClassHasStaticAttributecontainsEqual()
public
static containsEqual(mixed $value) : TraversableContainsEqual
Parameters
- $value : mixed
Return values
TraversableContainsEqualcontainsIdentical()
public
static containsIdentical(mixed $value) : TraversableContainsIdentical
Parameters
- $value : mixed
Return values
TraversableContainsIdenticalcontainsOnly()
public
static containsOnly(string $type) : TraversableContainsOnly
Parameters
- $type : string
Return values
TraversableContainsOnlycontainsOnlyInstancesOf()
public
static containsOnlyInstancesOf(string $className) : TraversableContainsOnly
Parameters
- $className : string
Return values
TraversableContainsOnlycount()
public
count() : int
Return values
intcountOf()
public
static countOf(int $count) : Count
Parameters
- $count : int
Return values
CountdirectoryExists()
public
static directoryExists() : DirectoryExists
Return values
DirectoryExistsequalTo()
public
static equalTo(mixed $value) : IsEqual
Parameters
- $value : mixed
Return values
IsEqualequalToCanonicalizing()
public
static equalToCanonicalizing(mixed $value) : IsEqualCanonicalizing
Parameters
- $value : mixed
Return values
IsEqualCanonicalizingequalToIgnoringCase()
public
static equalToIgnoringCase(mixed $value) : IsEqualIgnoringCase
Parameters
- $value : mixed
Return values
IsEqualIgnoringCaseequalToWithDelta()
public
static equalToWithDelta(mixed $value, float $delta) : IsEqualWithDelta
Parameters
- $value : mixed
- $delta : float
Return values
IsEqualWithDeltaexactly()
Returns a matcher that matches when the method is executed exactly $count times.
public
static exactly(int $count) : InvokedCount
Parameters
- $count : int
Return values
InvokedCountexpectDeprecation()
public
expectDeprecation() : void
https://github.com/sebastianbergmann/phpunit/issues/5062
expectDeprecationMessage()
public
expectDeprecationMessage(string $message) : void
https://github.com/sebastianbergmann/phpunit/issues/5062
Parameters
- $message : string
expectDeprecationMessageMatches()
public
expectDeprecationMessageMatches(string $regularExpression) : void
https://github.com/sebastianbergmann/phpunit/issues/5062
Parameters
- $regularExpression : string
expectError()
public
expectError() : void
https://github.com/sebastianbergmann/phpunit/issues/5062
expectErrorMessage()
public
expectErrorMessage(string $message) : void
https://github.com/sebastianbergmann/phpunit/issues/5062
Parameters
- $message : string
expectErrorMessageMatches()
public
expectErrorMessageMatches(string $regularExpression) : void
https://github.com/sebastianbergmann/phpunit/issues/5062
Parameters
- $regularExpression : string
expectException()
public
expectException(string $exception) : void
Parameters
- $exception : string
Tags
expectExceptionCode()
public
expectExceptionCode(int|string $code) : void
Parameters
- $code : int|string
expectExceptionMessage()
public
expectExceptionMessage(string $message) : void
Parameters
- $message : string
expectExceptionMessageMatches()
public
expectExceptionMessageMatches(string $regularExpression) : void
Parameters
- $regularExpression : string
expectExceptionObject()
Sets up an expectation for an exception to be raised by the code under test.
public
expectExceptionObject(Exception $exception) : void
Information for expected exception class, expected exception message, and expected exception code are retrieved from a given Exception object.
Parameters
- $exception : Exception
expectNotice()
public
expectNotice() : void
https://github.com/sebastianbergmann/phpunit/issues/5062
expectNoticeMessage()
public
expectNoticeMessage(string $message) : void
https://github.com/sebastianbergmann/phpunit/issues/5062
Parameters
- $message : string
expectNoticeMessageMatches()
public
expectNoticeMessageMatches(string $regularExpression) : void
https://github.com/sebastianbergmann/phpunit/issues/5062
Parameters
- $regularExpression : string
expectNotToPerformAssertions()
public
expectNotToPerformAssertions() : void
expectOutputRegex()
public
expectOutputRegex(string $expectedRegex) : void
Parameters
- $expectedRegex : string
expectOutputString()
public
expectOutputString(string $expectedString) : void
Parameters
- $expectedString : string
expectWarning()
public
expectWarning() : void
https://github.com/sebastianbergmann/phpunit/issues/5062
expectWarningMessage()
public
expectWarningMessage(string $message) : void
https://github.com/sebastianbergmann/phpunit/issues/5062
Parameters
- $message : string
expectWarningMessageMatches()
public
expectWarningMessageMatches(string $regularExpression) : void
https://github.com/sebastianbergmann/phpunit/issues/5062
Parameters
- $regularExpression : string
fail()
Fails a test with the given message.
public
static fail([string $message = '' ]) : void
Parameters
- $message : string = ''
Tags
fileExists()
public
static fileExists() : FileExists
Return values
FileExistsgetActualOutputForAssertion()
public
getActualOutputForAssertion() : string
Return values
stringgetCount()
Return the current assertion count.
public
static getCount() : int
Return values
intgetMockBuilder()
Returns a builder object to create mock objects using a fluent interface.
public
getMockBuilder(string $className) : MockBuilder
Parameters
- $className : string
Tags
Return values
MockBuildergetStatus()
public
getStatus() : int
Return values
intgetStatusMessage()
public
getStatusMessage() : string
Return values
stringgreaterThan()
public
static greaterThan(mixed $value) : GreaterThan
Parameters
- $value : mixed
Return values
GreaterThangreaterThanOrEqual()
public
static greaterThanOrEqual(mixed $value) : LogicalOr
Parameters
- $value : mixed
Return values
LogicalOrhasFailed()
public
hasFailed() : bool
Return values
boolidenticalTo()
public
static identicalTo(mixed $value) : IsIdentical
Parameters
- $value : mixed
Return values
IsIdenticalisEmpty()
public
static isEmpty() : IsEmpty
Return values
IsEmptyisFalse()
public
static isFalse() : IsFalse
Return values
IsFalseisFinite()
public
static isFinite() : IsFinite
Return values
IsFiniteisInfinite()
public
static isInfinite() : IsInfinite
Return values
IsInfiniteisInstanceOf()
public
static isInstanceOf(string $className) : IsInstanceOf
Parameters
- $className : string
Return values
IsInstanceOfisJson()
public
static isJson() : IsJson
Return values
IsJsonisNan()
public
static isNan() : IsNan
Return values
IsNanisNull()
public
static isNull() : IsNull
Return values
IsNullisReadable()
public
static isReadable() : IsReadable
Return values
IsReadableisTrue()
public
static isTrue() : IsTrue
Return values
IsTrueisType()
public
static isType(string $type) : IsType
Parameters
- $type : string
Return values
IsTypeisWritable()
public
static isWritable() : IsWritable
Return values
IsWritablelessThan()
public
static lessThan(mixed $value) : LessThan
Parameters
- $value : mixed
Return values
LessThanlessThanOrEqual()
public
static lessThanOrEqual(mixed $value) : LogicalOr
Parameters
- $value : mixed
Return values
LogicalOrlogicalAnd()
public
static logicalAnd() : LogicalAnd
Tags
Return values
LogicalAndlogicalNot()
public
static logicalNot(Constraint $constraint) : LogicalNot
Parameters
- $constraint : Constraint
Return values
LogicalNotlogicalOr()
public
static logicalOr() : LogicalOr
Return values
LogicalOrlogicalXor()
public
static logicalXor() : LogicalXor
Return values
LogicalXorlogoutMock()
public
logoutMock() : mixed
markAsRisky()
public
markAsRisky() : void
markTestIncomplete()
Mark the test as incomplete.
public
static markTestIncomplete([string $message = '' ]) : void
Parameters
- $message : string = ''
Tags
markTestSkipped()
Mark the test as skipped.
public
static markTestSkipped([string $message = '' ]) : void
Parameters
- $message : string = ''
Tags
matches()
public
static matches(string $string) : StringMatchesFormatDescription
Parameters
- $string : string
Return values
StringMatchesFormatDescriptionmatchesRegularExpression()
public
static matchesRegularExpression(string $pattern) : RegularExpression
Parameters
- $pattern : string
Return values
RegularExpressionnever()
Returns a matcher that matches when the method is never executed.
public
static never() : InvokedCount
Return values
InvokedCountobjectEquals()
public
static objectEquals(object $object[, string $method = 'equals' ]) : ObjectEquals
Parameters
- $object : object
- $method : string = 'equals'
Return values
ObjectEqualsobjectHasAttribute()
public
static objectHasAttribute(mixed $attributeName) : ObjectHasAttribute
https://github.com/sebastianbergmann/phpunit/issues/4601
Parameters
- $attributeName : mixed
Return values
ObjectHasAttributeonce()
Returns a matcher that matches when the method is executed exactly once.
public
static once() : InvokedCount
Return values
InvokedCountonConsecutiveCalls()
public
static onConsecutiveCalls(mixed ...$args) : ConsecutiveCalls
Parameters
- $args : mixed
Return values
ConsecutiveCallspresenceSubscriptionMock()
public
presenceSubscriptionMock([mixed $id = '1' ][, mixed $detailed = true ]) : mixed
Parameters
- $id : mixed = '1'
- $detailed : mixed = true
provides()
Returns the normalized test name as class::method.
public
provides() : array<int, ExecutionOrderDependency>
Return values
array<int, ExecutionOrderDependency>refreshMock()
public
refreshMock([mixed $failure = false ][, mixed $expiresIn = 3600 ]) : mixed
Parameters
- $failure : mixed = false
- $expiresIn : mixed = 3600
registerComparator()
public
registerComparator(Comparator $comparator) : void
Parameters
- $comparator : Comparator
requires()
Returns a list of normalized dependency names, class::method.
public
requires() : array<int, ExecutionOrderDependency>
This list can differ from the raw dependencies as the resolver has no need for the [!][shallow]clone prefix that is filtered out during normalization.
Return values
array<int, ExecutionOrderDependency>resetCount()
Reset the assertion counter.
public
static resetCount() : void
returnArgument()
public
static returnArgument(int $argumentIndex) : ReturnArgument
Parameters
- $argumentIndex : int
Return values
ReturnArgumentreturnCallback()
public
static returnCallback(mixed $callback) : ReturnCallback
Parameters
- $callback : mixed
Return values
ReturnCallbackreturnSelf()
Returns the current object.
public
static returnSelf() : ReturnSelf
This method is useful when mocking a fluent interface.
Return values
ReturnSelfreturnValue()
public
static returnValue(mixed $value) : ReturnStub
Parameters
- $value : mixed
Return values
ReturnStubreturnValueMap()
public
static returnValueMap(array<string|int, mixed> $valueMap) : ReturnValueMap
Parameters
- $valueMap : array<string|int, mixed>
Return values
ReturnValueMaprun()
Runs the test case and collects the results in a TestResult object.
public
run([TestResult|null $result = null ]) : TestResult
If no TestResult object is passed a new one will be created.
Parameters
- $result : TestResult|null = null
Tags
Return values
TestResultsetUpBeforeClass()
This method is called before the first test of this test class is run.
public
static setUpBeforeClass() : void
sortId()
public
sortId() : string
Return values
stringstringContains()
public
static stringContains(string $string[, bool $case = true ]) : StringContains
Parameters
- $string : string
- $case : bool = true
Return values
StringContainsstringEndsWith()
public
static stringEndsWith(string $suffix) : StringEndsWith
Parameters
- $suffix : string
Return values
StringEndsWithstringStartsWith()
public
static stringStartsWith(mixed $prefix) : StringStartsWith
Parameters
- $prefix : mixed
Return values
StringStartsWithsubscriptionMock()
public
subscriptionMock([mixed $expiresIn = 54000 ][, array<string|int, mixed> $eventFilters = ['/restapi/v1.0/account/~/extension/1/presence'] ]) : mixed
Parameters
- $expiresIn : mixed = 54000
- $eventFilters : array<string|int, mixed> = ['/restapi/v1.0/account/~/extension/1/presence']
tearDownAfterClass()
This method is called after the last test of this test class is run.
public
static tearDownAfterClass() : void
throwException()
public
static throwException(Throwable $exception) : Exception
Parameters
- $exception : Throwable
Return values
ExceptiontoString()
Returns a string representation of the test case.
public
toString() : string
Tags
Return values
stringassertPostConditions()
Performs assertions shared by all tests of a test case.
protected
assertPostConditions() : void
This method is called between test and tearDown().
assertPreConditions()
Performs assertions shared by all tests of a test case.
protected
assertPreConditions() : void
This method is called between setUp() and test.
createConfiguredMock()
Returns a configured mock object for the specified class.
protected
createConfiguredMock(string $originalClassName, array<string|int, mixed> $configuration) : MockObject
Parameters
- $originalClassName : string
- $configuration : array<string|int, mixed>
Tags
Return values
MockObjectcreateGuzzle()
protected
createGuzzle([array<string|int, mixed> $responses = [] ]) : mixed
Parameters
- $responses : array<string|int, mixed> = []
createMock()
Returns a mock object for the specified class.
protected
createMock(string $originalClassName) : MockObject
Parameters
- $originalClassName : string
Tags
Return values
MockObjectcreatePartialMock()
Returns a partial mock object for the specified class.
protected
createPartialMock(string $originalClassName, array<string|int, string> $methods) : MockObject
Parameters
- $originalClassName : string
- $methods : array<string|int, string>
Tags
Return values
MockObjectcreateResponse()
protected
createResponse([mixed $method = 'GET' ][, mixed $path = '' ][, array<string|int, mixed> $json = [] ][, mixed $status = 200 ]) : mixed
Parameters
- $method : mixed = 'GET'
- $path : mixed = ''
- $json : array<string|int, mixed> = []
- $status : mixed = 200
createStub()
Makes configurable stub for the specified class.
protected
createStub(string $originalClassName) : Stub
Parameters
- $originalClassName : string
Tags
Return values
StubcreateTestProxy()
Returns a test proxy for the specified class.
protected
createTestProxy(string $originalClassName[, array<string|int, mixed> $constructorArguments = [] ]) : MockObject
Parameters
- $originalClassName : string
- $constructorArguments : array<string|int, mixed> = []
Tags
Return values
MockObjectgetMockClass()
Mocks the specified class and returns the name of the mocked class.
protected
getMockClass(string $originalClassName[, null|array<string|int, mixed> $methods = [] ][, array<string|int, mixed> $arguments = [] ][, string $mockClassName = '' ][, bool $callOriginalConstructor = false ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, bool $cloneArguments = false ]) : string
Parameters
- $originalClassName : string
- $methods : null|array<string|int, mixed> = []
-
$methods
- $arguments : array<string|int, mixed> = []
- $mockClassName : string = ''
- $callOriginalConstructor : bool = false
- $callOriginalClone : bool = true
- $callAutoload : bool = true
- $cloneArguments : bool = false
Tags
Return values
stringgetMockForAbstractClass()
Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default.
protected
getMockForAbstractClass(string $originalClassName[, array<string|int, mixed> $arguments = [] ][, string $mockClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, array<string|int, mixed> $mockedMethods = [] ][, bool $cloneArguments = false ]) : MockObject
To mock concrete methods, use the 7th parameter ($mockedMethods).
Parameters
- $originalClassName : string
- $arguments : array<string|int, mixed> = []
- $mockClassName : string = ''
- $callOriginalConstructor : bool = true
- $callOriginalClone : bool = true
- $callAutoload : bool = true
- $mockedMethods : array<string|int, mixed> = []
- $cloneArguments : bool = false
Tags
Return values
MockObjectgetMockForTrait()
Returns 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.
protected
getMockForTrait(string $traitName[, array<string|int, mixed> $arguments = [] ][, string $mockClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, array<string|int, mixed> $mockedMethods = [] ][, bool $cloneArguments = false ]) : MockObject
Parameters
- $traitName : string
- $arguments : array<string|int, mixed> = []
- $mockClassName : string = ''
- $callOriginalConstructor : bool = true
- $callOriginalClone : bool = true
- $callAutoload : bool = true
- $mockedMethods : array<string|int, mixed> = []
- $cloneArguments : bool = false
Tags
Return values
MockObjectgetMockFromWsdl()
Returns a mock object based on the given WSDL file.
protected
getMockFromWsdl(string $wsdlFile[, string $originalClassName = '' ][, string $mockClassName = '' ][, array<string|int, mixed> $methods = [] ][, bool $callOriginalConstructor = true ][, array<string|int, mixed> $options = [] ]) : MockObject
Parameters
- $wsdlFile : string
- $originalClassName : string = ''
- $mockClassName : string = ''
- $methods : array<string|int, mixed> = []
- $callOriginalConstructor : bool = true
- $options : array<string|int, mixed> = []
Tags
Return values
MockObjectgetObjectForTrait()
Returns an object for the specified trait.
protected
getObjectForTrait(string $traitName[, array<string|int, mixed> $arguments = [] ][, string $traitClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ]) : object
Parameters
- $traitName : string
- $arguments : array<string|int, mixed> = []
- $traitClassName : string = ''
- $callOriginalConstructor : bool = true
- $callOriginalClone : bool = true
- $callAutoload : bool = true
Tags
Return values
objectgetSDK()
protected
getSDK([array<string|int, mixed> $responses = [] ][, mixed $authorized = true ]) : mixed
Parameters
- $responses : array<string|int, mixed> = []
- $authorized : mixed = true
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.
protected
iniSet(string $varName, string $newValue) : void
Parameters
- $varName : string
- $newValue : string
Tags
onNotSuccessfulTest()
This method is called when a test method did not execute successfully.
protected
onNotSuccessfulTest(Throwable $t) : void
Parameters
- $t : Throwable
Tags
prophesize()
protected
prophesize([string|null $classOrInterface = null ]) : ObjectProphecy
https://github.com/sebastianbergmann/phpunit/issues/4141
Parameters
- $classOrInterface : string|null = null
Tags
Return values
ObjectProphecyrecordDoubledType()
protected
recordDoubledType(string $originalClassName) : void
Parameters
- $originalClassName : string
runTest()
Override to run the test and assert its state.
protected
runTest() : mixed
Tags
setLocale()
This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.
protected
setLocale(mixed ...$args) : void
Parameters
- $args : mixed
Tags
setUp()
This method is called before each test.
protected
setUp() : void
tearDown()
This method is called after each test.
protected
tearDown() : void
checkExceptionExpectations()
private
checkExceptionExpectations(Throwable $throwable) : bool
Parameters
- $throwable : Throwable
Tags
Return values
boolcheckRequirements()
private
checkRequirements() : void
Tags
cleanupIniSettings()
private
cleanupIniSettings() : void
cleanupLocaleSettings()
private
cleanupLocaleSettings() : void
compareGlobalStateSnapshotPart()
private
compareGlobalStateSnapshotPart(array<string|int, mixed> $before, array<string|int, mixed> $after, string $header) : void
Parameters
- $before : array<string|int, mixed>
- $after : array<string|int, mixed>
- $header : string
Tags
compareGlobalStateSnapshots()
private
compareGlobalStateSnapshots(Snapshot $before, Snapshot $after) : void
Parameters
Tags
createGlobalStateSnapshot()
private
createGlobalStateSnapshot(bool $backupGlobals) : Snapshot
Parameters
- $backupGlobals : bool
Return values
SnapshotcreateMockObject()
private
createMockObject(string $originalClassName) : MockObject
Parameters
- $originalClassName : string
Tags
Return values
MockObjectcreateWarning()
private
static createWarning(string $warning) : void
Parameters
- $warning : string
Tags
detectLocationHint()
private
static detectLocationHint(string $message) : array<string|int, mixed>|null
Parameters
- $message : string
Return values
array<string|int, mixed>|nullgetMockObjectGenerator()
Get the mock object generator, creating it if it doesn't exist.
private
getMockObjectGenerator() : Generator
Return values
GeneratorgetProphet()
private
getProphet() : Prophet
Return values
ProphethandleDependencies()
private
handleDependencies() : bool
Return values
boolisCallableTestMethod()
private
isCallableTestMethod(string $dependency) : bool
Parameters
- $dependency : string
Return values
boolisValidClassAttributeName()
private
static isValidClassAttributeName(string $attributeName) : bool
Parameters
- $attributeName : string
Return values
boolisValidObjectAttributeName()
private
static isValidObjectAttributeName(string $attributeName) : bool
Parameters
- $attributeName : string
Return values
boolmarkSkippedForMissingDependency()
private
markSkippedForMissingDependency(ExecutionOrderDependency $dependency) : void
Parameters
- $dependency : ExecutionOrderDependency
markSkippedForNotSpecifyingDependency()
private
markSkippedForNotSpecifyingDependency() : void
markWarningForUncallableDependency()
private
markWarningForUncallableDependency(ExecutionOrderDependency $dependency) : void
Parameters
- $dependency : ExecutionOrderDependency
registerMockObjectsFromTestArguments()
private
registerMockObjectsFromTestArguments(array<string|int, mixed> $testArguments[, array<string|int, mixed> &$visited = [] ]) : void
Parameters
- $testArguments : array<string|int, mixed>
- $visited : array<string|int, mixed> = []
Tags
restoreGlobalState()
private
restoreGlobalState() : void
Tags
runInSeparateProcess()
private
runInSeparateProcess() : bool
Return values
boolsetDoesNotPerformAssertionsFromAnnotation()
private
setDoesNotPerformAssertionsFromAnnotation() : void
shouldInvocationMockerBeReset()
private
shouldInvocationMockerBeReset(MockObject $mock) : bool
Parameters
- $mock : MockObject
Tags
Return values
boolsnapshotGlobalState()
private
snapshotGlobalState() : void
startOutputBuffering()
private
startOutputBuffering() : void
stopOutputBuffering()
private
stopOutputBuffering() : void
Tags
unregisterCustomComparators()
private
unregisterCustomComparators() : void
verifyMockObjects()
private
verifyMockObjects() : void