GetClassPropertiesTest
extends AbstractMethodUnitTest
in package
Tests for the \PHP_CodeSniffer\Files\File:getClassProperties method.
Tags
Table of Contents
Properties
- $fileExtension : string
- The file extension of the test case file (without leading dot).
- $phpcsFile : File
- The \PHP_CodeSniffer\Files\File object containing the parsed contents of the test case file.
- $tabWidth : int
- The tab width setting to use when tokenizing the file.
Methods
- anything() : IsAnything
- arrayHasKey() : ArrayHasKey
- assertArrayHasKey() : void
- Asserts that an array has a specified key.
- assertArrayIsEqualToArrayIgnoringListOfKeys() : void
- Asserts that two arrays are equal while ignoring a list of keys.
- assertArrayIsEqualToArrayOnlyConsideringListOfKeys() : void
- Asserts that two arrays are equal while only considering a list of keys.
- assertArrayIsIdenticalToArrayIgnoringListOfKeys() : void
- Asserts that two arrays are equal while ignoring a list of keys.
- assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys() : void
- Asserts that two arrays are identical while only considering a list of keys.
- assertArrayNotHasKey() : void
- Asserts that an array does not have a specified key.
- assertContains() : void
- Asserts that a haystack contains a needle.
- assertContainsEquals() : void
- assertContainsNotOnlyArray() : void
- Asserts that a haystack does not contain only values of type array.
- assertContainsNotOnlyBool() : void
- Asserts that a haystack does not contain only values of type bool.
- assertContainsNotOnlyCallable() : void
- Asserts that a haystack does not contain only values of type callable.
- assertContainsNotOnlyClosedResource() : void
- Asserts that a haystack does not contain only values of type closed resource.
- assertContainsNotOnlyFloat() : void
- Asserts that a haystack does not contain only values of type float.
- assertContainsNotOnlyInstancesOf() : void
- Asserts that a haystack does not contain only instances of a specified interface or class name.
- assertContainsNotOnlyInt() : void
- Asserts that a haystack does not contain only values of type int.
- assertContainsNotOnlyIterable() : void
- Asserts that a haystack does not contain only values of type iterable.
- assertContainsNotOnlyNull() : void
- Asserts that a haystack does not contain only values of type null.
- assertContainsNotOnlyNumeric() : void
- Asserts that a haystack does not contain only values of type numeric.
- assertContainsNotOnlyObject() : void
- Asserts that a haystack does not contain only values of type object.
- assertContainsNotOnlyResource() : void
- Asserts that a haystack does not contain only values of type resource.
- assertContainsNotOnlyScalar() : void
- Asserts that a haystack does not contain only values of type scalar.
- assertContainsNotOnlyString() : void
- Asserts that a haystack does not contain only values of type string.
- assertContainsOnly() : void
- Asserts that a haystack contains only values of a given type.
- assertContainsOnlyArray() : void
- Asserts that a haystack contains only values of type array.
- assertContainsOnlyBool() : void
- Asserts that a haystack contains only values of type bool.
- assertContainsOnlyCallable() : void
- Asserts that a haystack contains only values of type callable.
- assertContainsOnlyClosedResource() : void
- Asserts that a haystack contains only values of type closed resource.
- assertContainsOnlyFloat() : void
- Asserts that a haystack contains only values of type float.
- assertContainsOnlyInstancesOf() : void
- Asserts that a haystack contains only instances of a specified interface or class name.
- assertContainsOnlyInt() : void
- Asserts that a haystack contains only values of type int.
- assertContainsOnlyIterable() : void
- Asserts that a haystack contains only values of type iterable.
- assertContainsOnlyNull() : void
- Asserts that a haystack contains only values of type null.
- assertContainsOnlyNumeric() : void
- Asserts that a haystack contains only values of type numeric.
- assertContainsOnlyObject() : void
- Asserts that a haystack contains only values of type object.
- assertContainsOnlyResource() : void
- Asserts that a haystack contains only values of type resource.
- assertContainsOnlyScalar() : void
- Asserts that a haystack contains only values of type scalar.
- assertContainsOnlyString() : void
- Asserts that a haystack contains only values of type string.
- 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.
- 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).
- 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.
- assertFileMatchesFormat() : void
- Asserts that a string matches a given format string.
- assertFileMatchesFormatFile() : void
- Asserts that a string matches a given format string.
- 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).
- 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.
- assertIsList() : void
- 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.
- assertNotNull() : void
- Asserts that a variable is not null.
- 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
- assertObjectHasProperty() : void
- Asserts that an object has a specified property.
- assertObjectNotEquals() : void
- assertObjectNotHasProperty() : void
- Asserts that an object does not have a specified property.
- 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
- assertStringContainsStringIgnoringLineEndings() : 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).
- assertStringEqualsStringIgnoringLineEndings() : void
- Asserts that two strings are equal except for line endings.
- 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.
- callback() : Callback
- containsEqual() : TraversableContainsEqual
- containsIdentical() : TraversableContainsIdentical
- containsOnly() : TraversableContainsOnly
- containsOnlyArray() : TraversableContainsOnly
- containsOnlyBool() : TraversableContainsOnly
- containsOnlyCallable() : TraversableContainsOnly
- containsOnlyClosedResource() : TraversableContainsOnly
- containsOnlyFloat() : TraversableContainsOnly
- containsOnlyInstancesOf() : TraversableContainsOnly
- containsOnlyInt() : TraversableContainsOnly
- containsOnlyIterable() : TraversableContainsOnly
- containsOnlyNull() : TraversableContainsOnly
- containsOnlyNumeric() : TraversableContainsOnly
- containsOnlyObject() : TraversableContainsOnly
- containsOnlyResource() : TraversableContainsOnly
- containsOnlyScalar() : TraversableContainsOnly
- containsOnlyString() : TraversableContainsOnly
- countOf() : Count
- dataGetClassProperties() : array<string, array<string, string|array<string, bool|int>>>
- Data provider.
- dataNotAClassException() : array<string, array<string, string|int>>
- Data provider.
- directoryExists() : DirectoryExists
- equalTo() : IsEqual
- equalToCanonicalizing() : IsEqualCanonicalizing
- equalToIgnoringCase() : IsEqualIgnoringCase
- equalToWithDelta() : IsEqualWithDelta
- expectRunTimeException() : void
- Helper method to tell PHPUnit to expect a PHPCS RuntimeException in a PHPUnit cross-version compatible manner.
- fail() : never
- Fails a test with the given message.
- fileExists() : FileExists
- getCount() : int
- Return the current assertion count.
- getTargetToken() : int
- Get the token pointer for a target token based on a specific comment found on the line before.
- getTargetTokenFromFile() : int
- Get the token pointer for a target token based on a specific comment found on the line before.
- greaterThan() : GreaterThan
- greaterThanOrEqual() : LogicalOr
- identicalTo() : IsIdentical
- initializeFile() : void
- Initialize & tokenize \PHP_CodeSniffer\Files\File with code from the test case file.
- isArray() : IsType
- isBool() : IsType
- isCallable() : IsType
- isClosedResource() : IsType
- isEmpty() : IsEmpty
- isFalse() : IsFalse
- isFinite() : IsFinite
- isFloat() : IsType
- isInfinite() : IsInfinite
- isInstanceOf() : IsInstanceOf
- isInt() : IsType
- isIterable() : IsType
- isJson() : IsJson
- isList() : IsList
- isNan() : IsNan
- isNull() : IsNull
- isNumeric() : IsType
- isObject() : IsType
- isReadable() : IsReadable
- isResource() : IsType
- isScalar() : IsType
- isString() : IsType
- isTrue() : IsTrue
- isType() : IsType
- isWritable() : IsWritable
- lessThan() : LessThan
- lessThanOrEqual() : LogicalOr
- logicalAnd() : LogicalAnd
- logicalNot() : LogicalNot
- logicalOr() : LogicalOr
- logicalXor() : LogicalXor
- markTestIncomplete() : never
- Mark the test as incomplete.
- markTestSkipped() : never
- Mark the test as skipped.
- matches() : StringMatchesFormatDescription
- matchesRegularExpression() : RegularExpression
- objectEquals() : ObjectEquals
- resetCount() : void
- Reset the assertion counter.
- setUpBeforeClass() : void
- This method is called before the first test of this test class is run.
- stringContains() : StringContains
- stringEndsWith() : StringEndsWith
- stringEqualsStringIgnoringLineEndings() : StringEqualsStringIgnoringLineEndings
- stringStartsWith() : StringStartsWith
- tearDownAfterClass() : void
- This method is called after the last test of this test class is run.
- testGetClassProperties() : void
- Test retrieving the properties for a class declaration.
- testNotAClassException() : void
- Test receiving an expected exception when a non class token is passed.
- any() : AnyInvokedCount
- Returns a matcher that matches when the method is executed zero or more times.
- assertPostConditions() : void
- Performs assertions shared by all tests of a test case.
- assertPreConditions() : void
- Performs assertions shared by all tests of a test case.
- 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.
- createConfiguredMock() : MockObject|RealInstanceType
- Creates (and configures) a mock object for the specified interface or class.
- createConfiguredStub() : RealInstanceType|Stub
- Creates (and configures) a test stub for the specified interface or class.
- createMock() : MockObject|RealInstanceType
- Creates a mock object for the specified interface or class.
- createMockForIntersectionOfInterfaces() : MockObject
- createPartialMock() : MockObject|RealInstanceType
- Creates a partial mock object for the specified interface or class.
- createStub() : RealInstanceType|Stub
- Creates a test stub for the specified interface or class.
- createStubForIntersectionOfInterfaces() : Stub
- createTestProxy() : MockObject|RealInstanceType
- Creates a test proxy for the specified class.
- exactly() : InvokedCount
- Returns a matcher that matches when the method is executed exactly $count times.
- 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.
- expectNotToPerformAssertions() : void
- expectOutputRegex() : void
- expectOutputString() : void
- expectUserDeprecationMessage() : void
- expectUserDeprecationMessageMatches() : void
- getActualOutputForAssertion() : string
- getMockBuilder() : MockBuilder<string|int, RealInstanceType>
- Returns a builder object to create mock objects using a fluent interface.
- getMockForAbstractClass() : MockObject|RealInstanceType
- Creates 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
- 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() : MockObject
- Creates a mock object based on the given WSDL file.
- getObjectForTrait() : object
- Creates an object that uses the specified trait.
- 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.
- never() : InvokedCount
- Returns a matcher that matches when the method is never executed.
- once() : InvokedCount
- Returns a matcher that matches when the method is executed exactly once.
- onConsecutiveCalls() : ConsecutiveCalls
- onNotSuccessfulTest() : never
- This method is called when a test method did not execute successfully.
- registerComparator() : void
- registerFailureType() : void
- returnArgument() : ReturnArgument
- returnCallback() : ReturnCallback
- returnSelf() : ReturnSelf
- returnValue() : ReturnStub
- returnValueMap() : ReturnValueMap
- 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.
- throwException() : Exception
- transformException() : Throwable
Properties
$fileExtension
The file extension of the test case file (without leading dot).
protected
static string
$fileExtension
= 'inc'
This allows child classes to overrule the default inc with, for instance,
js or css when applicable.
$phpcsFile
The \PHP_CodeSniffer\Files\File object containing the parsed contents of the test case file.
protected
static File
$phpcsFile
$tabWidth
The tab width setting to use when tokenizing the file.
protected
static int
$tabWidth
= 4
This allows for test case files to use a different tab width than the default.
Methods
anything()
public
final static anything() : IsAnything
Return values
IsAnythingarrayHasKey()
public
final static arrayHasKey(mixed $key) : ArrayHasKey
Parameters
- $key : mixed
Return values
ArrayHasKeyassertArrayHasKey()
Asserts that an array has a specified key.
public
final static assertArrayHasKey(mixed $key, array<string|int, mixed>|ArrayAccess<string|int, mixed> $array[, string $message = '' ]) : void
Parameters
- $key : mixed
- $array : array<string|int, mixed>|ArrayAccess<string|int, mixed>
- $message : string = ''
Tags
assertArrayIsEqualToArrayIgnoringListOfKeys()
Asserts that two arrays are equal while ignoring a list of keys.
public
final static assertArrayIsEqualToArrayIgnoringListOfKeys(array<string|int, mixed> $expected, array<string|int, mixed> $actual, array<int, string|int> $keysToBeIgnored[, string $message = '' ]) : void
Parameters
- $expected : array<string|int, mixed>
- $actual : array<string|int, mixed>
- $keysToBeIgnored : array<int, string|int>
- $message : string = ''
Tags
assertArrayIsEqualToArrayOnlyConsideringListOfKeys()
Asserts that two arrays are equal while only considering a list of keys.
public
final static assertArrayIsEqualToArrayOnlyConsideringListOfKeys(array<string|int, mixed> $expected, array<string|int, mixed> $actual, array<int, string|int> $keysToBeConsidered[, string $message = '' ]) : void
Parameters
- $expected : array<string|int, mixed>
- $actual : array<string|int, mixed>
- $keysToBeConsidered : array<int, string|int>
- $message : string = ''
Tags
assertArrayIsIdenticalToArrayIgnoringListOfKeys()
Asserts that two arrays are equal while ignoring a list of keys.
public
final static assertArrayIsIdenticalToArrayIgnoringListOfKeys(array<string|int, mixed> $expected, array<string|int, mixed> $actual, array<int, string|int> $keysToBeIgnored[, string $message = '' ]) : void
Parameters
- $expected : array<string|int, mixed>
- $actual : array<string|int, mixed>
- $keysToBeIgnored : array<int, string|int>
- $message : string = ''
Tags
assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys()
Asserts that two arrays are identical while only considering a list of keys.
public
final static assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys(array<string|int, mixed> $expected, array<string|int, mixed> $actual, array<int, string|int> $keysToBeConsidered[, string $message = '' ]) : void
Parameters
- $expected : array<string|int, mixed>
- $actual : array<string|int, mixed>
- $keysToBeConsidered : array<int, string|int>
- $message : string = ''
Tags
assertArrayNotHasKey()
Asserts that an array does not have a specified key.
public
final static assertArrayNotHasKey(mixed $key, array<string|int, mixed>|ArrayAccess<string|int, mixed> $array[, string $message = '' ]) : void
Parameters
- $key : mixed
- $array : array<string|int, mixed>|ArrayAccess<string|int, mixed>
- $message : string = ''
Tags
assertContains()
Asserts that a haystack contains a needle.
public
final 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
final static assertContainsEquals(mixed $needle, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $needle : mixed
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyArray()
Asserts that a haystack does not contain only values of type array.
public
final static assertContainsNotOnlyArray(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyBool()
Asserts that a haystack does not contain only values of type bool.
public
final static assertContainsNotOnlyBool(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyCallable()
Asserts that a haystack does not contain only values of type callable.
public
final static assertContainsNotOnlyCallable(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyClosedResource()
Asserts that a haystack does not contain only values of type closed resource.
public
final static assertContainsNotOnlyClosedResource(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyFloat()
Asserts that a haystack does not contain only values of type float.
public
final static assertContainsNotOnlyFloat(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyInstancesOf()
Asserts that a haystack does not contain only instances of a specified interface or class name.
public
final static assertContainsNotOnlyInstancesOf(class-string $className, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $className : class-string
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyInt()
Asserts that a haystack does not contain only values of type int.
public
final static assertContainsNotOnlyInt(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyIterable()
Asserts that a haystack does not contain only values of type iterable.
public
final static assertContainsNotOnlyIterable(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyNull()
Asserts that a haystack does not contain only values of type null.
public
final static assertContainsNotOnlyNull(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyNumeric()
Asserts that a haystack does not contain only values of type numeric.
public
final static assertContainsNotOnlyNumeric(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyObject()
Asserts that a haystack does not contain only values of type object.
public
final static assertContainsNotOnlyObject(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyResource()
Asserts that a haystack does not contain only values of type resource.
public
final static assertContainsNotOnlyResource(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyScalar()
Asserts that a haystack does not contain only values of type scalar.
public
final static assertContainsNotOnlyScalar(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsNotOnlyString()
Asserts that a haystack does not contain only values of type string.
public
final static assertContainsNotOnlyString(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnly()
Asserts that a haystack contains only values of a given type.
public
final static assertContainsOnly("array"|"bool"|"boolean"|"callable"|"double"|"float"|"int"|"integer"|"iterable"|"null"|"numeric"|"object"|"real"|"resource (closed)"|"resource"|"scalar"|"string" $type, iterable<string|int, mixed> $haystack[, bool|null $isNativeType = null ][, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/6055
Parameters
- $type : "array"|"bool"|"boolean"|"callable"|"double"|"float"|"int"|"integer"|"iterable"|"null"|"numeric"|"object"|"real"|"resource (closed)"|"resource"|"scalar"|"string"
- $haystack : iterable<string|int, mixed>
- $isNativeType : bool|null = null
- $message : string = ''
Tags
assertContainsOnlyArray()
Asserts that a haystack contains only values of type array.
public
final static assertContainsOnlyArray(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyBool()
Asserts that a haystack contains only values of type bool.
public
final static assertContainsOnlyBool(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyCallable()
Asserts that a haystack contains only values of type callable.
public
final static assertContainsOnlyCallable(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyClosedResource()
Asserts that a haystack contains only values of type closed resource.
public
final static assertContainsOnlyClosedResource(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyFloat()
Asserts that a haystack contains only values of type float.
public
final static assertContainsOnlyFloat(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyInstancesOf()
Asserts that a haystack contains only instances of a specified interface or class name.
public
final static assertContainsOnlyInstancesOf(T> $className, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $className : T>
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyInt()
Asserts that a haystack contains only values of type int.
public
final static assertContainsOnlyInt(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyIterable()
Asserts that a haystack contains only values of type iterable.
public
final static assertContainsOnlyIterable(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyNull()
Asserts that a haystack contains only values of type null.
public
final static assertContainsOnlyNull(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyNumeric()
Asserts that a haystack contains only values of type numeric.
public
final static assertContainsOnlyNumeric(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyObject()
Asserts that a haystack contains only values of type object.
public
final static assertContainsOnlyObject(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyResource()
Asserts that a haystack contains only values of type resource.
public
final static assertContainsOnlyResource(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyScalar()
Asserts that a haystack contains only values of type scalar.
public
final static assertContainsOnlyScalar(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertContainsOnlyString()
Asserts that a haystack contains only values of type string.
public
final static assertContainsOnlyString(iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertCount()
Asserts the number of elements of an array, Countable or Traversable.
public
final 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
final static assertDirectoryDoesNotExist(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryExists()
Asserts that a directory exists.
public
final static assertDirectoryExists(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryIsNotReadable()
Asserts that a directory exists and is not readable.
public
final static assertDirectoryIsNotReadable(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryIsNotWritable()
Asserts that a directory exists and is not writable.
public
final static assertDirectoryIsNotWritable(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryIsReadable()
Asserts that a directory exists and is readable.
public
final static assertDirectoryIsReadable(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDirectoryIsWritable()
Asserts that a directory exists and is writable.
public
final static assertDirectoryIsWritable(string $directory[, string $message = '' ]) : void
Parameters
- $directory : string
- $message : string = ''
Tags
assertDoesNotMatchRegularExpression()
Asserts that a string does not match a given regular expression.
public
final 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
final static assertEmpty(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertEquals()
Asserts that two variables are equal.
public
final static assertEquals(mixed $expected, mixed $actual[, string $message = '' ]) : void
Comparison is performed using the == operator (loose comparison) and may be performed by a type-specific comparator which may apply type coercion.
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertEqualsCanonicalizing()
Asserts that two variables are equal (canonicalizing).
public
final static assertEqualsCanonicalizing(mixed $expected, mixed $actual[, string $message = '' ]) : void
Comparison is performed using the == operator (loose comparison) and may be performed by a type-specific comparator which may apply type coercion.
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertEqualsIgnoringCase()
Asserts that two variables are equal (ignoring case).
public
final static assertEqualsIgnoringCase(mixed $expected, mixed $actual[, string $message = '' ]) : void
Comparison is performed using the == operator (loose comparison) and may be performed by a type-specific comparator which may apply type coercion.
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertEqualsWithDelta()
Asserts that two variables are equal (with delta).
public
final static assertEqualsWithDelta(mixed $expected, mixed $actual, float $delta[, string $message = '' ]) : void
Comparison is performed using the == operator (loose comparison) and may be performed by a type-specific comparator which may apply type coercion.
Parameters
- $expected : mixed
- $actual : mixed
- $delta : float
- $message : string = ''
Tags
assertFalse()
Asserts that a condition is false.
public
final static assertFalse(mixed $condition[, string $message = '' ]) : void
Parameters
- $condition : mixed
- $message : string = ''
Tags
assertFileDoesNotExist()
Asserts that a file does not exist.
public
final 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
final 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
final 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
final static assertFileEqualsIgnoringCase(string $expected, string $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : string
- $message : string = ''
Tags
assertFileExists()
Asserts that a file exists.
public
final static assertFileExists(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertFileIsNotReadable()
Asserts that a file exists and is not readable.
public
final static assertFileIsNotReadable(string $file[, string $message = '' ]) : void
Parameters
- $file : string
- $message : string = ''
Tags
assertFileIsNotWritable()
Asserts that a file exists and is not writable.
public
final static assertFileIsNotWritable(string $file[, string $message = '' ]) : void
Parameters
- $file : string
- $message : string = ''
Tags
assertFileIsReadable()
Asserts that a file exists and is readable.
public
final static assertFileIsReadable(string $file[, string $message = '' ]) : void
Parameters
- $file : string
- $message : string = ''
Tags
assertFileIsWritable()
Asserts that a file exists and is writable.
public
final static assertFileIsWritable(string $file[, string $message = '' ]) : void
Parameters
- $file : string
- $message : string = ''
Tags
assertFileMatchesFormat()
Asserts that a string matches a given format string.
public
final static assertFileMatchesFormat(string $format, string $actualFile[, string $message = '' ]) : void
Parameters
- $format : string
- $actualFile : string
- $message : string = ''
Tags
assertFileMatchesFormatFile()
Asserts that a string matches a given format string.
public
final static assertFileMatchesFormatFile(string $formatFile, string $actualFile[, string $message = '' ]) : void
Parameters
- $formatFile : string
- $actualFile : string
- $message : string = ''
Tags
assertFileNotEquals()
Asserts that the contents of one file is not equal to the contents of another file.
public
final 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
final 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
final static assertFileNotEqualsIgnoringCase(string $expected, string $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : string
- $message : string = ''
Tags
assertFinite()
Asserts that a variable is finite.
public
final static assertFinite(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertGreaterThan()
Asserts that a value is greater than another value.
public
final static assertGreaterThan(mixed $minimum, mixed $actual[, string $message = '' ]) : void
Parameters
- $minimum : mixed
- $actual : mixed
- $message : string = ''
Tags
assertGreaterThanOrEqual()
Asserts that a value is greater than or equal to another value.
public
final static assertGreaterThanOrEqual(mixed $minimum, mixed $actual[, string $message = '' ]) : void
Parameters
- $minimum : mixed
- $actual : mixed
- $message : string = ''
Tags
assertInfinite()
Asserts that a variable is infinite.
public
final static assertInfinite(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertInstanceOf()
Asserts that a variable is of a given type.
public
final static assertInstanceOf(ExpectedType> $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : ExpectedType>
- $actual : mixed
- $message : string = ''
Tags
assertIsArray()
Asserts that a variable is of type array.
public
final static assertIsArray(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsBool()
Asserts that a variable is of type bool.
public
final static assertIsBool(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsCallable()
Asserts that a variable is of type callable.
public
final 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
final static assertIsClosedResource(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsFloat()
Asserts that a variable is of type float.
public
final static assertIsFloat(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsInt()
Asserts that a variable is of type int.
public
final static assertIsInt(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsIterable()
Asserts that a variable is of type iterable.
public
final static assertIsIterable(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsList()
public
final static assertIsList(mixed $array[, string $message = '' ]) : void
Parameters
- $array : mixed
- $message : string = ''
Tags
assertIsNotArray()
Asserts that a variable is not of type array.
public
final static assertIsNotArray(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotBool()
Asserts that a variable is not of type bool.
public
final static assertIsNotBool(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotCallable()
Asserts that a variable is not of type callable.
public
final static assertIsNotCallable(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotClosedResource()
Asserts that a variable is not of type resource.
public
final static assertIsNotClosedResource(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotFloat()
Asserts that a variable is not of type float.
public
final static assertIsNotFloat(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotInt()
Asserts that a variable is not of type int.
public
final static assertIsNotInt(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotIterable()
Asserts that a variable is not of type iterable.
public
final static assertIsNotIterable(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotNumeric()
Asserts that a variable is not of type numeric.
public
final static assertIsNotNumeric(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotObject()
Asserts that a variable is not of type object.
public
final 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
final static assertIsNotReadable(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertIsNotResource()
Asserts that a variable is not of type resource.
public
final static assertIsNotResource(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotScalar()
Asserts that a variable is not of type scalar.
public
final static assertIsNotScalar(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsNotString()
Asserts that a variable is not of type string.
public
final 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
final static assertIsNotWritable(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertIsNumeric()
Asserts that a variable is of type numeric.
public
final static assertIsNumeric(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsObject()
Asserts that a variable is of type object.
public
final static assertIsObject(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsReadable()
Asserts that a file/dir is readable.
public
final static assertIsReadable(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertIsResource()
Asserts that a variable is of type resource.
public
final static assertIsResource(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsScalar()
Asserts that a variable is of type scalar.
public
final static assertIsScalar(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsString()
Asserts that a variable is of type string.
public
final static assertIsString(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertIsWritable()
Asserts that a file/dir exists and is writable.
public
final static assertIsWritable(string $filename[, string $message = '' ]) : void
Parameters
- $filename : string
- $message : string = ''
Tags
assertJson()
Asserts that a string is a valid JSON string.
public
final static assertJson(string $actual[, string $message = '' ]) : void
Parameters
- $actual : string
- $message : string = ''
Tags
assertJsonFileEqualsJsonFile()
Asserts that two JSON files are equal.
public
final 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
final 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
final 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
final 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
final 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
final 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
final static assertLessThan(mixed $maximum, mixed $actual[, string $message = '' ]) : void
Parameters
- $maximum : mixed
- $actual : mixed
- $message : string = ''
Tags
assertLessThanOrEqual()
Asserts that a value is smaller than or equal to another value.
public
final static assertLessThanOrEqual(mixed $maximum, mixed $actual[, string $message = '' ]) : void
Parameters
- $maximum : mixed
- $actual : mixed
- $message : string = ''
Tags
assertMatchesRegularExpression()
Asserts that a string matches a given regular expression.
public
final 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
final static assertNan(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertNotContains()
Asserts that a haystack does not contain a needle.
public
final 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
final static assertNotContainsEquals(mixed $needle, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $needle : mixed
- $haystack : iterable<string|int, mixed>
- $message : string = ''
Tags
assertNotContainsOnly()
Asserts that a haystack does not contain only values of a given type.
public
final static assertNotContainsOnly("array"|"bool"|"boolean"|"callable"|"double"|"float"|"int"|"integer"|"iterable"|"null"|"numeric"|"object"|"real"|"resource (closed)"|"resource"|"scalar"|"string" $type, iterable<string|int, mixed> $haystack[, bool|null $isNativeType = null ][, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/6055
Parameters
- $type : "array"|"bool"|"boolean"|"callable"|"double"|"float"|"int"|"integer"|"iterable"|"null"|"numeric"|"object"|"real"|"resource (closed)"|"resource"|"scalar"|"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
final 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
final static assertNotEmpty(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertNotEquals()
Asserts that two variables are not equal.
public
final static assertNotEquals(mixed $expected, mixed $actual[, string $message = '' ]) : void
Comparison is performed using the == operator (loose comparison) and may be performed by a type-specific comparator which may apply type coercion.
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertNotEqualsCanonicalizing()
Asserts that two variables are not equal (canonicalizing).
public
final static assertNotEqualsCanonicalizing(mixed $expected, mixed $actual[, string $message = '' ]) : void
Comparison is performed using the == operator (loose comparison) and may be performed by a type-specific comparator which may apply type coercion.
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertNotEqualsIgnoringCase()
Asserts that two variables are not equal (ignoring case).
public
final static assertNotEqualsIgnoringCase(mixed $expected, mixed $actual[, string $message = '' ]) : void
Comparison is performed using the == operator (loose comparison) and may be performed by a type-specific comparator which may apply type coercion.
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
Tags
assertNotEqualsWithDelta()
Asserts that two variables are not equal (with delta).
public
final static assertNotEqualsWithDelta(mixed $expected, mixed $actual, float $delta[, string $message = '' ]) : void
Comparison is performed using the == operator (loose comparison) and may be performed by a type-specific comparator which may apply type coercion.
Parameters
- $expected : mixed
- $actual : mixed
- $delta : float
- $message : string = ''
Tags
assertNotFalse()
Asserts that a condition is not false.
public
final 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
final static assertNotInstanceOf(ExpectedType> $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : ExpectedType>
- $actual : mixed
- $message : string = ''
Tags
assertNotNull()
Asserts that a variable is not null.
public
final static assertNotNull(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertNotSame()
Asserts that two variables do not have the same type and value.
public
final static assertNotSame(mixed $expected, mixed $actual[, string $message = '' ]) : void
Used on objects, it asserts that two variables do not reference the same object.
Comparison is performed using the === operator.
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
final 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
final static assertNotTrue(mixed $condition[, string $message = '' ]) : void
Parameters
- $condition : mixed
- $message : string = ''
Tags
assertNull()
Asserts that a variable is null.
public
final static assertNull(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
Tags
assertObjectEquals()
public
final static assertObjectEquals(object $expected, object $actual[, string $method = 'equals' ][, string $message = '' ]) : void
Parameters
- $expected : object
- $actual : object
- $method : string = 'equals'
- $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
assertObjectNotEquals()
public
final static assertObjectNotEquals(object $expected, object $actual[, string $method = 'equals' ][, string $message = '' ]) : void
Parameters
- $expected : object
- $actual : object
- $method : string = 'equals'
- $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
assertSame()
Asserts that two variables have the same type and value.
public
final static assertSame(ExpectedType $expected, mixed $actual[, string $message = '' ]) : void
Used on objects, it asserts that two variables reference the same object.
Comparison is performed using the === operator.
Parameters
- $expected : ExpectedType
- $actual : mixed
- $message : string = ''
Tags
assertSameSize()
Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same.
public
final 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
final static assertStringContainsString(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
- $needle : string
- $haystack : string
- $message : string = ''
Tags
assertStringContainsStringIgnoringCase()
public
final static assertStringContainsStringIgnoringCase(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
- $needle : string
- $haystack : string
- $message : string = ''
Tags
assertStringContainsStringIgnoringLineEndings()
public
final static assertStringContainsStringIgnoringLineEndings(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
final static assertStringEndsNotWith(non-empty-string $suffix, string $string[, string $message = '' ]) : void
Parameters
- $suffix : non-empty-string
- $string : string
- $message : string = ''
Tags
assertStringEndsWith()
Asserts that a string ends with a given suffix.
public
final static assertStringEndsWith(non-empty-string $suffix, string $string[, string $message = '' ]) : void
Parameters
- $suffix : non-empty-string
- $string : string
- $message : string = ''
Tags
assertStringEqualsFile()
Asserts that the contents of a string is equal to the contents of a file.
public
final 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
final 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
final static assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualString : string
- $message : string = ''
Tags
assertStringEqualsStringIgnoringLineEndings()
Asserts that two strings are equal except for line endings.
public
final static assertStringEqualsStringIgnoringLineEndings(string $expected, string $actual[, string $message = '' ]) : void
Parameters
- $expected : string
- $actual : string
- $message : string = ''
Tags
assertStringMatchesFormat()
Asserts that a string matches a given format string.
public
final 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
final static assertStringMatchesFormatFile(string $formatFile, string $string[, string $message = '' ]) : void
Parameters
- $formatFile : string
- $string : string
- $message : string = ''
Tags
assertStringNotContainsString()
public
final static assertStringNotContainsString(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
- $needle : string
- $haystack : string
- $message : string = ''
Tags
assertStringNotContainsStringIgnoringCase()
public
final 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
final 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
final 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
final 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
final static assertStringNotMatchesFormat(string $format, string $string[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/5472
Parameters
- $format : string
- $string : string
- $message : string = ''
Tags
assertStringNotMatchesFormatFile()
Asserts that a string does not match a given format string.
public
final static assertStringNotMatchesFormatFile(string $formatFile, string $string[, string $message = '' ]) : void
https://github.com/sebastianbergmann/phpunit/issues/5472
Parameters
- $formatFile : string
- $string : string
- $message : string = ''
Tags
assertStringStartsNotWith()
Asserts that a string starts not with a given prefix.
public
final static assertStringStartsNotWith(non-empty-string $prefix, string $string[, string $message = '' ]) : void
Parameters
- $prefix : non-empty-string
- $string : string
- $message : string = ''
Tags
assertStringStartsWith()
Asserts that a string starts with a given prefix.
public
final static assertStringStartsWith(non-empty-string $prefix, string $string[, string $message = '' ]) : void
Parameters
- $prefix : non-empty-string
- $string : string
- $message : string = ''
Tags
assertThat()
Evaluates a PHPUnit\Framework\Constraint matcher object.
public
final 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
final static assertTrue(mixed $condition[, string $message = '' ]) : void
Parameters
- $condition : mixed
- $message : string = ''
Tags
assertXmlFileEqualsXmlFile()
Asserts that two XML files are equal.
public
final 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
final 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
final static assertXmlStringEqualsXmlFile(string $expectedFile, string $actualXml[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualXml : string
- $message : string = ''
Tags
assertXmlStringEqualsXmlString()
Asserts that two XML documents are equal.
public
final static assertXmlStringEqualsXmlString(string $expectedXml, string $actualXml[, string $message = '' ]) : void
Parameters
- $expectedXml : string
- $actualXml : string
- $message : string = ''
Tags
assertXmlStringNotEqualsXmlFile()
Asserts that two XML documents are not equal.
public
final static assertXmlStringNotEqualsXmlFile(string $expectedFile, string $actualXml[, string $message = '' ]) : void
Parameters
- $expectedFile : string
- $actualXml : string
- $message : string = ''
Tags
assertXmlStringNotEqualsXmlString()
Asserts that two XML documents are not equal.
public
final static assertXmlStringNotEqualsXmlString(string $expectedXml, string $actualXml[, string $message = '' ]) : void
Parameters
- $expectedXml : string
- $actualXml : string
- $message : string = ''
Tags
callback()
public
final static callback(callable(CallbackInput $callback): bool $callback) : Callback
Parameters
- $callback : callable(CallbackInput $callback): bool
Tags
Return values
CallbackcontainsEqual()
public
final static containsEqual(mixed $value) : TraversableContainsEqual
Parameters
- $value : mixed
Return values
TraversableContainsEqualcontainsIdentical()
public
final static containsIdentical(mixed $value) : TraversableContainsIdentical
Parameters
- $value : mixed
Return values
TraversableContainsIdenticalcontainsOnly()
public
final static containsOnly("array"|"bool"|"boolean"|"callable"|"double"|"float"|"int"|"integer"|"iterable"|"null"|"numeric"|"object"|"real"|"resource (closed)"|"resource"|"scalar"|"string" $type) : TraversableContainsOnly
https://github.com/sebastianbergmann/phpunit/issues/6055
Parameters
- $type : "array"|"bool"|"boolean"|"callable"|"double"|"float"|"int"|"integer"|"iterable"|"null"|"numeric"|"object"|"real"|"resource (closed)"|"resource"|"scalar"|"string"
Tags
Return values
TraversableContainsOnlycontainsOnlyArray()
public
final static containsOnlyArray() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyBool()
public
final static containsOnlyBool() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyCallable()
public
final static containsOnlyCallable() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyClosedResource()
public
final static containsOnlyClosedResource() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyFloat()
public
final static containsOnlyFloat() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyInstancesOf()
public
final static containsOnlyInstancesOf(class-string $className) : TraversableContainsOnly
Parameters
- $className : class-string
Tags
Return values
TraversableContainsOnlycontainsOnlyInt()
public
final static containsOnlyInt() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyIterable()
public
final static containsOnlyIterable() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyNull()
public
final static containsOnlyNull() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyNumeric()
public
final static containsOnlyNumeric() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyObject()
public
final static containsOnlyObject() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyResource()
public
final static containsOnlyResource() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyScalar()
public
final static containsOnlyScalar() : TraversableContainsOnly
Return values
TraversableContainsOnlycontainsOnlyString()
public
final static containsOnlyString() : TraversableContainsOnly
Return values
TraversableContainsOnlycountOf()
public
final static countOf(int $count) : Count
Parameters
- $count : int
Return values
CountdataGetClassProperties()
Data provider.
public
static dataGetClassProperties() : array<string, array<string, string|array<string, bool|int>>>
Tags
Return values
array<string, array<string, string|array<string, bool|int>>>dataNotAClassException()
Data provider.
public
static dataNotAClassException() : array<string, array<string, string|int>>
Tags
Return values
array<string, array<string, string|int>>directoryExists()
public
final static directoryExists() : DirectoryExists
Return values
DirectoryExistsequalTo()
public
final static equalTo(mixed $value) : IsEqual
Parameters
- $value : mixed
Return values
IsEqualequalToCanonicalizing()
public
final static equalToCanonicalizing(mixed $value) : IsEqualCanonicalizing
Parameters
- $value : mixed
Return values
IsEqualCanonicalizingequalToIgnoringCase()
public
final static equalToIgnoringCase(mixed $value) : IsEqualIgnoringCase
Parameters
- $value : mixed
Return values
IsEqualIgnoringCaseequalToWithDelta()
public
final static equalToWithDelta(mixed $value, float $delta) : IsEqualWithDelta
Parameters
- $value : mixed
- $delta : float
Return values
IsEqualWithDeltaexpectRunTimeException()
Helper method to tell PHPUnit to expect a PHPCS RuntimeException in a PHPUnit cross-version compatible manner.
public
expectRunTimeException(string $message) : void
Parameters
- $message : string
-
The expected exception message.
fail()
Fails a test with the given message.
public
final static fail([string $message = '' ]) : never
Parameters
- $message : string = ''
Tags
Return values
neverfileExists()
public
final static fileExists() : FileExists
Return values
FileExistsgetCount()
Return the current assertion count.
public
final static getCount() : int
Return values
intgetTargetToken()
Get the token pointer for a target token based on a specific comment found on the line before.
public
getTargetToken(string $commentString, int|string|array<string|int, mixed> $tokenType[, string $tokenContent = null ]) : int
Note: the test delimiter comment MUST start with "/* test" to allow this function to distinguish between comments used in a test and test delimiters.
Parameters
- $commentString : string
-
The delimiter comment to look for.
- $tokenType : int|string|array<string|int, mixed>
-
The type of token(s) to look for.
- $tokenContent : string = null
-
Optional. The token content for the target token.
Return values
intgetTargetTokenFromFile()
Get the token pointer for a target token based on a specific comment found on the line before.
public
static getTargetTokenFromFile(File $phpcsFile, string $commentString, int|string|array<string|int, mixed> $tokenType[, string $tokenContent = null ]) : int
Note: the test delimiter comment MUST start with "/* test" to allow this function to distinguish between comments used in a test and test delimiters.
Parameters
- $phpcsFile : File
-
The file to find the token in.
- $commentString : string
-
The delimiter comment to look for.
- $tokenType : int|string|array<string|int, mixed>
-
The type of token(s) to look for.
- $tokenContent : string = null
-
Optional. The token content for the target token.
Tags
Return values
intgreaterThan()
public
final static greaterThan(mixed $value) : GreaterThan
Parameters
- $value : mixed
Return values
GreaterThangreaterThanOrEqual()
public
final static greaterThanOrEqual(mixed $value) : LogicalOr
Parameters
- $value : mixed
Return values
LogicalOridenticalTo()
public
final static identicalTo(mixed $value) : IsIdentical
Parameters
- $value : mixed
Return values
IsIdenticalinitializeFile()
Initialize & tokenize \PHP_CodeSniffer\Files\File with code from the test case file.
public
static initializeFile() : void
The test case file for a unit test class has to be in the same directory directory and use the same file name as the test class, using the .inc extension.
Tags
isArray()
public
final static isArray() : IsType
Return values
IsTypeisBool()
public
final static isBool() : IsType
Return values
IsTypeisCallable()
public
final static isCallable() : IsType
Return values
IsTypeisClosedResource()
public
final static isClosedResource() : IsType
Return values
IsTypeisEmpty()
public
final static isEmpty() : IsEmpty
Return values
IsEmptyisFalse()
public
final static isFalse() : IsFalse
Return values
IsFalseisFinite()
public
final static isFinite() : IsFinite
Return values
IsFiniteisFloat()
public
final static isFloat() : IsType
Return values
IsTypeisInfinite()
public
final static isInfinite() : IsInfinite
Return values
IsInfiniteisInstanceOf()
public
final static isInstanceOf(string $className) : IsInstanceOf
Parameters
- $className : string
Tags
Return values
IsInstanceOfisInt()
public
final static isInt() : IsType
Return values
IsTypeisIterable()
public
final static isIterable() : IsType
Return values
IsTypeisJson()
public
final static isJson() : IsJson
Return values
IsJsonisList()
public
final static isList() : IsList
Return values
IsListisNan()
public
final static isNan() : IsNan
Return values
IsNanisNull()
public
final static isNull() : IsNull
Return values
IsNullisNumeric()
public
final static isNumeric() : IsType
Return values
IsTypeisObject()
public
final static isObject() : IsType
Return values
IsTypeisReadable()
public
final static isReadable() : IsReadable
Return values
IsReadableisResource()
public
final static isResource() : IsType
Return values
IsTypeisScalar()
public
final static isScalar() : IsType
Return values
IsTypeisString()
public
final static isString() : IsType
Return values
IsTypeisTrue()
public
final static isTrue() : IsTrue
Return values
IsTrueisType()
public
final static isType("array"|"bool"|"boolean"|"callable"|"double"|"float"|"int"|"integer"|"iterable"|"null"|"numeric"|"object"|"real"|"resource (closed)"|"resource"|"scalar"|"string" $type) : IsType
https://github.com/sebastianbergmann/phpunit/issues/6052
Parameters
- $type : "array"|"bool"|"boolean"|"callable"|"double"|"float"|"int"|"integer"|"iterable"|"null"|"numeric"|"object"|"real"|"resource (closed)"|"resource"|"scalar"|"string"
Tags
Return values
IsTypeisWritable()
public
final static isWritable() : IsWritable
Return values
IsWritablelessThan()
public
final static lessThan(mixed $value) : LessThan
Parameters
- $value : mixed
Return values
LessThanlessThanOrEqual()
public
final static lessThanOrEqual(mixed $value) : LogicalOr
Parameters
- $value : mixed
Return values
LogicalOrlogicalAnd()
public
final static logicalAnd(mixed ...$constraints) : LogicalAnd
Parameters
- $constraints : mixed
Tags
Return values
LogicalAndlogicalNot()
public
final static logicalNot(Constraint $constraint) : LogicalNot
Parameters
- $constraint : Constraint
Return values
LogicalNotlogicalOr()
public
final static logicalOr(mixed ...$constraints) : LogicalOr
Parameters
- $constraints : mixed
Return values
LogicalOrlogicalXor()
public
final static logicalXor(mixed ...$constraints) : LogicalXor
Parameters
- $constraints : mixed
Return values
LogicalXormarkTestIncomplete()
Mark the test as incomplete.
public
final static markTestIncomplete([string $message = '' ]) : never
Parameters
- $message : string = ''
Tags
Return values
nevermarkTestSkipped()
Mark the test as skipped.
public
final static markTestSkipped([string $message = '' ]) : never
Parameters
- $message : string = ''
Tags
Return values
nevermatches()
public
final static matches(string $string) : StringMatchesFormatDescription
Parameters
- $string : string
Return values
StringMatchesFormatDescriptionmatchesRegularExpression()
public
final static matchesRegularExpression(string $pattern) : RegularExpression
Parameters
- $pattern : string
Return values
RegularExpressionobjectEquals()
public
final static objectEquals(object $object[, string $method = 'equals' ]) : ObjectEquals
Parameters
- $object : object
- $method : string = 'equals'
Return values
ObjectEqualsresetCount()
Reset the assertion counter.
public
final static resetCount() : void
setUpBeforeClass()
This method is called before the first test of this test class is run.
public
static setUpBeforeClass() : void
Tags
stringContains()
public
final static stringContains(string $string[, bool $case = true ]) : StringContains
Parameters
- $string : string
- $case : bool = true
Return values
StringContainsstringEndsWith()
public
final static stringEndsWith(non-empty-string $suffix) : StringEndsWith
Parameters
- $suffix : non-empty-string
Tags
Return values
StringEndsWithstringEqualsStringIgnoringLineEndings()
public
final static stringEqualsStringIgnoringLineEndings(string $string) : StringEqualsStringIgnoringLineEndings
Parameters
- $string : string
Return values
StringEqualsStringIgnoringLineEndingsstringStartsWith()
public
final static stringStartsWith(non-empty-string $prefix) : StringStartsWith
Parameters
- $prefix : non-empty-string
Tags
Return values
StringStartsWithtearDownAfterClass()
This method is called after the last test of this test class is run.
public
static tearDownAfterClass() : void
Tags
testGetClassProperties()
Test retrieving the properties for a class declaration.
public
testGetClassProperties(string $testMarker, array<string, bool> $expected) : void
Parameters
- $testMarker : string
-
The comment which prefaces the target token in the test file.
- $expected : array<string, bool>
-
Expected function output.
Tags
testNotAClassException()
Test receiving an expected exception when a non class token is passed.
public
testNotAClassException(string $testMarker, int|string $tokenType) : void
Parameters
- $testMarker : string
-
The comment which prefaces the target token in the test file.
- $tokenType : int|string
-
The type of token to look for after the marker.
Tags
any()
Returns a matcher that matches when the method is executed zero or more times.
protected
final any() : AnyInvokedCount
Return values
AnyInvokedCountassertPostConditions()
Performs assertions shared by all tests of a test case.
protected
assertPostConditions() : void
This method is called between test and tearDown().
Tags
assertPreConditions()
Performs assertions shared by all tests of a test case.
protected
assertPreConditions() : void
This method is called between setUp() and test.
Tags
atLeast()
Returns a matcher that matches when the method is executed at least N times.
protected
final atLeast(int $requiredInvocations) : InvokedAtLeastCount
Parameters
- $requiredInvocations : int
Return values
InvokedAtLeastCountatLeastOnce()
Returns a matcher that matches when the method is executed at least once.
protected
final atLeastOnce() : InvokedAtLeastOnce
Return values
InvokedAtLeastOnceatMost()
Returns a matcher that matches when the method is executed at most N times.
protected
final atMost(int $allowedInvocations) : InvokedAtMostCount
Parameters
- $allowedInvocations : int
Return values
InvokedAtMostCountcreateConfiguredMock()
Creates (and configures) a mock object for the specified interface or class.
protected
final createConfiguredMock(RealInstanceType> $originalClassName, array<non-empty-string, mixed> $configuration) : MockObject|RealInstanceType
Parameters
- $originalClassName : RealInstanceType>
- $configuration : array<non-empty-string, mixed>
Tags
Return values
MockObject|RealInstanceTypecreateConfiguredStub()
Creates (and configures) a test stub for the specified interface or class.
protected
final static createConfiguredStub(RealInstanceType> $originalClassName, array<non-empty-string, mixed> $configuration) : RealInstanceType|Stub
Parameters
- $originalClassName : RealInstanceType>
- $configuration : array<non-empty-string, mixed>
Tags
Return values
RealInstanceType|StubcreateMock()
Creates a mock object for the specified interface or class.
protected
final createMock(RealInstanceType> $originalClassName) : MockObject|RealInstanceType
Parameters
- $originalClassName : RealInstanceType>
Tags
Return values
MockObject|RealInstanceTypecreateMockForIntersectionOfInterfaces()
protected
final createMockForIntersectionOfInterfaces(array<int, class-string> $interfaces) : MockObject
Parameters
- $interfaces : array<int, class-string>
Tags
Return values
MockObjectcreatePartialMock()
Creates a partial mock object for the specified interface or class.
protected
final createPartialMock(RealInstanceType> $originalClassName, array<int, non-empty-string> $methods) : MockObject|RealInstanceType
Parameters
- $originalClassName : RealInstanceType>
- $methods : array<int, non-empty-string>
Tags
Return values
MockObject|RealInstanceTypecreateStub()
Creates a test stub for the specified interface or class.
protected
final static createStub(RealInstanceType> $originalClassName) : RealInstanceType|Stub
Parameters
- $originalClassName : RealInstanceType>
Tags
Return values
RealInstanceType|StubcreateStubForIntersectionOfInterfaces()
protected
final static createStubForIntersectionOfInterfaces(array<int, class-string> $interfaces) : Stub
Parameters
- $interfaces : array<int, class-string>
Tags
Return values
StubcreateTestProxy()
Creates a test proxy for the specified class.
protected
final createTestProxy(RealInstanceType> $originalClassName[, array<string|int, mixed> $constructorArguments = [] ]) : MockObject|RealInstanceType
https://github.com/sebastianbergmann/phpunit/issues/5240
Parameters
- $originalClassName : RealInstanceType>
- $constructorArguments : array<string|int, mixed> = []
Tags
Return values
MockObject|RealInstanceTypeexactly()
Returns a matcher that matches when the method is executed exactly $count times.
protected
final exactly(int $count) : InvokedCount
Parameters
- $count : int
Return values
InvokedCountexpectException()
protected
final expectException(Throwable> $exception) : void
Parameters
- $exception : Throwable>
expectExceptionCode()
protected
final expectExceptionCode(int|string $code) : void
Parameters
- $code : int|string
expectExceptionMessage()
protected
final expectExceptionMessage(string $message) : void
Parameters
- $message : string
expectExceptionMessageMatches()
protected
final expectExceptionMessageMatches(string $regularExpression) : void
Parameters
- $regularExpression : string
expectExceptionObject()
Sets up an expectation for an exception to be raised by the code under test.
protected
final 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
expectNotToPerformAssertions()
protected
final expectNotToPerformAssertions() : void
expectOutputRegex()
protected
final expectOutputRegex(string $expectedRegex) : void
Parameters
- $expectedRegex : string
expectOutputString()
protected
final expectOutputString(string $expectedString) : void
Parameters
- $expectedString : string
expectUserDeprecationMessage()
protected
final expectUserDeprecationMessage(non-empty-string $expectedUserDeprecationMessage) : void
Parameters
- $expectedUserDeprecationMessage : non-empty-string
expectUserDeprecationMessageMatches()
protected
final expectUserDeprecationMessageMatches(non-empty-string $expectedUserDeprecationMessageRegularExpression) : void
Parameters
- $expectedUserDeprecationMessageRegularExpression : non-empty-string
getActualOutputForAssertion()
protected
final getActualOutputForAssertion() : string
Return values
stringgetMockBuilder()
Returns a builder object to create mock objects using a fluent interface.
protected
final getMockBuilder(RealInstanceType> $className) : MockBuilder<string|int, RealInstanceType>
Parameters
- $className : RealInstanceType>
Tags
Return values
MockBuilder<string|int, RealInstanceType>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.
protected
final getMockForAbstractClass(RealInstanceType> $originalClassName[, array<string|int, mixed> $arguments = [] ][, string $mockClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, array<int, non-empty-string> $mockedMethods = [] ][, bool $cloneArguments = false ]) : MockObject|RealInstanceType
https://github.com/sebastianbergmann/phpunit/issues/5241
To mock concrete methods, use the 7th parameter ($mockedMethods).
Parameters
- $originalClassName : RealInstanceType>
- $arguments : array<string|int, mixed> = []
- $mockClassName : string = ''
- $callOriginalConstructor : bool = true
- $callOriginalClone : bool = true
- $callAutoload : bool = true
- $mockedMethods : array<int, non-empty-string> = []
- $cloneArguments : bool = false
Tags
Return values
MockObject|RealInstanceTypegetMockForTrait()
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.
protected
final getMockForTrait(trait-string $traitName[, array<string|int, mixed> $arguments = [] ][, string $mockClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, array<int, non-empty-string> $mockedMethods = [] ][, bool $cloneArguments = false ]) : MockObject
https://github.com/sebastianbergmann/phpunit/issues/5243
Parameters
- $traitName : trait-string
- $arguments : array<string|int, mixed> = []
- $mockClassName : string = ''
- $callOriginalConstructor : bool = true
- $callOriginalClone : bool = true
- $callAutoload : bool = true
- $mockedMethods : array<int, non-empty-string> = []
- $cloneArguments : bool = false
Tags
Return values
MockObjectgetMockFromWsdl()
Creates a mock object based on the given WSDL file.
protected
final getMockFromWsdl(string $wsdlFile[, string $originalClassName = '' ][, string $mockClassName = '' ][, array<int, string> $methods = [] ][, bool $callOriginalConstructor = true ][, array<int, mixed> $options = [] ]) : MockObject
https://github.com/sebastianbergmann/phpunit/issues/5242
Parameters
- $wsdlFile : string
- $originalClassName : string = ''
- $mockClassName : string = ''
- $methods : array<int, string> = []
- $callOriginalConstructor : bool = true
- $options : array<int, mixed> = []
Tags
Return values
MockObjectgetObjectForTrait()
Creates an object that uses the specified trait.
protected
final getObjectForTrait(trait-string $traitName[, array<string|int, mixed> $arguments = [] ][, string $traitClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ]) : object
https://github.com/sebastianbergmann/phpunit/issues/5244
Parameters
- $traitName : trait-string
- $arguments : array<string|int, mixed> = []
- $traitClassName : string = ''
- $callOriginalConstructor : bool = true
- $callOriginalClone : bool = true
- $callAutoload : bool = true
Tags
Return values
objectiniSet()
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
final iniSet(string $varName, string $newValue) : void
https://github.com/sebastianbergmann/phpunit/issues/5214
Parameters
- $varName : string
- $newValue : string
Tags
never()
Returns a matcher that matches when the method is never executed.
protected
final never() : InvokedCount
Return values
InvokedCountonce()
Returns a matcher that matches when the method is executed exactly once.
protected
final once() : InvokedCount
Return values
InvokedCountonConsecutiveCalls()
protected
final onConsecutiveCalls(mixed ...$arguments) : ConsecutiveCalls
Use $double->willReturn() instead of $double->will($this->onConsecutiveCalls())
Parameters
- $arguments : mixed
Tags
Return values
ConsecutiveCallsonNotSuccessfulTest()
This method is called when a test method did not execute successfully.
protected
onNotSuccessfulTest(Throwable $t) : never
Parameters
- $t : Throwable
Tags
Return values
neverregisterComparator()
protected
final registerComparator(Comparator $comparator) : void
Parameters
- $comparator : Comparator
registerFailureType()
protected
final registerFailureType(class-string $classOrInterface) : void
Parameters
- $classOrInterface : class-string
returnArgument()
protected
final returnArgument(int $argumentIndex) : ReturnArgument
Use $double->willReturnArgument() instead of $double->will($this->returnArgument())
Parameters
- $argumentIndex : int
Tags
Return values
ReturnArgumentreturnCallback()
protected
final returnCallback(callable $callback) : ReturnCallback
Use $double->willReturnCallback() instead of $double->will($this->returnCallback())
Parameters
- $callback : callable
Tags
Return values
ReturnCallbackreturnSelf()
protected
final returnSelf() : ReturnSelf
Use $double->willReturnSelf() instead of $double->will($this->returnSelf())
Tags
Return values
ReturnSelfreturnValue()
protected
final returnValue(mixed $value) : ReturnStub
Use $double->willReturn() instead of $double->will($this->returnValue())
Parameters
- $value : mixed
Tags
Return values
ReturnStubreturnValueMap()
protected
final returnValueMap(array<string|int, mixed> $valueMap) : ReturnValueMap
Use $double->willReturnMap() instead of $double->will($this->returnValueMap())
Parameters
- $valueMap : array<string|int, mixed>
Tags
Return values
ReturnValueMapsetLocale()
This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.
protected
final setLocale(mixed ...$arguments) : void
https://github.com/sebastianbergmann/phpunit/issues/5216
Parameters
- $arguments : mixed
Tags
setUp()
This method is called before each test.
protected
setUp() : void
Tags
tearDown()
This method is called after each test.
protected
tearDown() : void
Tags
throwException()
protected
final throwException(Throwable $exception) : Exception
Parameters
- $exception : Throwable
Return values
ExceptiontransformException()
protected
transformException(Throwable $t) : Throwable
Parameters
- $t : Throwable