abstract class Assert (View source)

Methods

static void
assertArrayIsEqualToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = '')

Asserts that two arrays are equal while only considering a list of keys.

static void
assertArrayIsEqualToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = '')

Asserts that two arrays are equal while ignoring a list of keys.

static void
assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = '')

Asserts that two arrays are identical while only considering a list of keys.

static void
assertArrayIsIdenticalToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = '')

Asserts that two arrays are equal while ignoring a list of keys.

static void
assertArrayHasKey(mixed $key, array|ArrayAccess $array, string $message = '')

Asserts that an array has a specified key.

static void
assertArrayNotHasKey(mixed $key, array|ArrayAccess $array, string $message = '')

Asserts that an array does not have a specified key.

static void
assertIsList(mixed $array, string $message = '')

No description

static void
assertContains(mixed $needle, iterable $haystack, string $message = '')

Asserts that a haystack contains a needle.

static void
assertContainsEquals(mixed $needle, iterable $haystack, string $message = '')

No description

static void
assertNotContains(mixed $needle, iterable $haystack, string $message = '')

Asserts that a haystack does not contain a needle.

static void
assertNotContainsEquals(mixed $needle, iterable $haystack, string $message = '')

No description

static void
assertContainsOnlyArray(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type array.

static void
assertContainsOnlyBool(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type bool.

static void
assertContainsOnlyCallable(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type callable.

static void
assertContainsOnlyFloat(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type float.

static void
assertContainsOnlyInt(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type int.

static void
assertContainsOnlyIterable(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type iterable.

static void
assertContainsOnlyNull(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type null.

static void
assertContainsOnlyNumeric(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type numeric.

static void
assertContainsOnlyObject(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type object.

static void
assertContainsOnlyResource(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type resource.

static void
assertContainsOnlyClosedResource(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type closed resource.

static void
assertContainsOnlyScalar(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type scalar.

static void
assertContainsOnlyString(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type string.

static void
assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = '')

Asserts that a haystack contains only instances of a specified interface or class name.

static void
assertContainsNotOnlyArray(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type array.

static void
assertContainsNotOnlyBool(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type bool.

static void
assertContainsNotOnlyCallable(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type callable.

static void
assertContainsNotOnlyFloat(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type float.

static void
assertContainsNotOnlyInt(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type int.

static void
assertContainsNotOnlyIterable(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type iterable.

static void
assertContainsNotOnlyNull(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type null.

static void
assertContainsNotOnlyNumeric(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type numeric.

static void
assertContainsNotOnlyObject(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type object.

static void
assertContainsNotOnlyResource(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type resource.

static void
assertContainsNotOnlyClosedResource(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type closed resource.

static void
assertContainsNotOnlyScalar(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type scalar.

static void
assertContainsNotOnlyString(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type string.

static void
assertContainsNotOnlyInstancesOf(string $className, iterable $haystack, string $message = '')

Asserts that a haystack does not contain only instances of a specified interface or class name.

static void
assertCount(int $expectedCount, Countable|iterable $haystack, string $message = '')

Asserts the number of elements of an array, Countable or Traversable.

static void
assertNotCount(int $expectedCount, Countable|iterable $haystack, string $message = '')

Asserts the number of elements of an array, Countable or Traversable.

static void
assertEquals(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are equal.

static void
assertEqualsCanonicalizing(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are equal (canonicalizing).

static void
assertEqualsIgnoringCase(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are equal (ignoring case).

static void
assertEqualsWithDelta(mixed $expected, mixed $actual, float $delta, string $message = '')

Asserts that two variables are equal (with delta).

static void
assertNotEquals(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are not equal.

static void
assertNotEqualsCanonicalizing(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are not equal (canonicalizing).

static void
assertNotEqualsIgnoringCase(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are not equal (ignoring case).

static void
assertNotEqualsWithDelta(mixed $expected, mixed $actual, float $delta, string $message = '')

Asserts that two variables are not equal (with delta).

static void
assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = '')

No description

static void
assertObjectNotEquals(object $expected, object $actual, string $method = 'equals', string $message = '')

No description

static void
assertEmpty(mixed $actual, string $message = '')

Asserts that a variable is empty.

static void
assertNotEmpty(mixed $actual, string $message = '')

Asserts that a variable is not empty.

static void
assertGreaterThan(mixed $minimum, mixed $actual, string $message = '')

Asserts that a value is greater than another value.

static void
assertGreaterThanOrEqual(mixed $minimum, mixed $actual, string $message = '')

Asserts that a value is greater than or equal to another value.

static void
assertLessThan(mixed $maximum, mixed $actual, string $message = '')

Asserts that a value is smaller than another value.

static void
assertLessThanOrEqual(mixed $maximum, mixed $actual, string $message = '')

Asserts that a value is smaller than or equal to another value.

static void
assertFileEquals(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is equal to the contents of another file.

static void
assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is equal to the contents of another file (canonicalizing).

static void
assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is equal to the contents of another file (ignoring case).

static void
assertFileNotEquals(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is not equal to the contents of another file.

static void
assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is not equal to the contents of another file (canonicalizing).

static void
assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is not equal to the contents of another file (ignoring case).

static void
assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is equal to the contents of a file.

static void
assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is equal to the contents of a file (canonicalizing).

static void
assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is equal to the contents of a file (ignoring case).

static void
assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is not equal to the contents of a file.

static void
assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is not equal to the contents of a file (canonicalizing).

static void
assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is not equal to the contents of a file (ignoring case).

static void
assertIsReadable(string $filename, string $message = '')

Asserts that a file/dir is readable.

static void
assertIsNotReadable(string $filename, string $message = '')

Asserts that a file/dir exists and is not readable.

static void
assertIsWritable(string $filename, string $message = '')

Asserts that a file/dir exists and is writable.

static void
assertIsNotWritable(string $filename, string $message = '')

Asserts that a file/dir exists and is not writable.

static void
assertDirectoryExists(string $directory, string $message = '')

Asserts that a directory exists.

static void
assertDirectoryDoesNotExist(string $directory, string $message = '')

Asserts that a directory does not exist.

static void
assertDirectoryIsReadable(string $directory, string $message = '')

Asserts that a directory exists and is readable.

static void
assertDirectoryIsNotReadable(string $directory, string $message = '')

Asserts that a directory exists and is not readable.

static void
assertDirectoryIsWritable(string $directory, string $message = '')

Asserts that a directory exists and is writable.

static void
assertDirectoryIsNotWritable(string $directory, string $message = '')

Asserts that a directory exists and is not writable.

static void
assertFileExists(string $filename, string $message = '')

Asserts that a file exists.

static void
assertFileDoesNotExist(string $filename, string $message = '')

Asserts that a file does not exist.

static void
assertFileIsReadable(string $file, string $message = '')

Asserts that a file exists and is readable.

static void
assertFileIsNotReadable(string $file, string $message = '')

Asserts that a file exists and is not readable.

static void
assertFileIsWritable(string $file, string $message = '')

Asserts that a file exists and is writable.

static void
assertFileIsNotWritable(string $file, string $message = '')

Asserts that a file exists and is not writable.

static void
assertTrue(mixed $condition, string $message = '')

Asserts that a condition is true.

static void
assertNotTrue(mixed $condition, string $message = '')

Asserts that a condition is not true.

static void
assertFalse(mixed $condition, string $message = '')

Asserts that a condition is false.

static void
assertNotFalse(mixed $condition, string $message = '')

Asserts that a condition is not false.

static void
assertNull(mixed $actual, string $message = '')

Asserts that a variable is null.

static void
assertNotNull(mixed $actual, string $message = '')

Asserts that a variable is not null.

static void
assertFinite(mixed $actual, string $message = '')

Asserts that a variable is finite.

static void
assertInfinite(mixed $actual, string $message = '')

Asserts that a variable is infinite.

static void
assertNan(mixed $actual, string $message = '')

Asserts that a variable is nan.

static void
assertObjectHasProperty(string $propertyName, object $object, string $message = '')

Asserts that an object has a specified property.

static void
assertObjectNotHasProperty(string $propertyName, object $object, string $message = '')

Asserts that an object does not have a specified property.

static void
assertSame(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables have the same type and value.

static void
assertNotSame(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables do not have the same type and value.

static void
assertInstanceOf(string $expected, mixed $actual, string $message = '')

Asserts that a variable is of a given type.

static void
assertNotInstanceOf(string $expected, mixed $actual, string $message = '')

Asserts that a variable is not of a given type.

static void
assertIsArray(mixed $actual, string $message = '')

Asserts that a variable is of type array.

static void
assertIsBool(mixed $actual, string $message = '')

Asserts that a variable is of type bool.

static void
assertIsFloat(mixed $actual, string $message = '')

Asserts that a variable is of type float.

static void
assertIsInt(mixed $actual, string $message = '')

Asserts that a variable is of type int.

static void
assertIsNumeric(mixed $actual, string $message = '')

Asserts that a variable is of type numeric.

static void
assertIsObject(mixed $actual, string $message = '')

Asserts that a variable is of type object.

static void
assertIsResource(mixed $actual, string $message = '')

Asserts that a variable is of type resource.

static void
assertIsClosedResource(mixed $actual, string $message = '')

Asserts that a variable is of type resource and is closed.

static void
assertIsString(mixed $actual, string $message = '')

Asserts that a variable is of type string.

static void
assertIsScalar(mixed $actual, string $message = '')

Asserts that a variable is of type scalar.

static void
assertIsCallable(mixed $actual, string $message = '')

Asserts that a variable is of type callable.

static void
assertIsIterable(mixed $actual, string $message = '')

Asserts that a variable is of type iterable.

static void
assertIsNotArray(mixed $actual, string $message = '')

Asserts that a variable is not of type array.

static void
assertIsNotBool(mixed $actual, string $message = '')

Asserts that a variable is not of type bool.

static void
assertIsNotFloat(mixed $actual, string $message = '')

Asserts that a variable is not of type float.

static void
assertIsNotInt(mixed $actual, string $message = '')

Asserts that a variable is not of type int.

static void
assertIsNotNumeric(mixed $actual, string $message = '')

Asserts that a variable is not of type numeric.

static void
assertIsNotObject(mixed $actual, string $message = '')

Asserts that a variable is not of type object.

static void
assertIsNotResource(mixed $actual, string $message = '')

Asserts that a variable is not of type resource.

static void
assertIsNotClosedResource(mixed $actual, string $message = '')

Asserts that a variable is not of type resource.

static void
assertIsNotString(mixed $actual, string $message = '')

Asserts that a variable is not of type string.

static void
assertIsNotScalar(mixed $actual, string $message = '')

Asserts that a variable is not of type scalar.

static void
assertIsNotCallable(mixed $actual, string $message = '')

Asserts that a variable is not of type callable.

static void
assertIsNotIterable(mixed $actual, string $message = '')

Asserts that a variable is not of type iterable.

static void
assertMatchesRegularExpression(string $pattern, string $string, string $message = '')

Asserts that a string matches a given regular expression.

static void
assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = '')

Asserts that a string does not match a given regular expression.

static void
assertSameSize(Countable|iterable $expected, Countable|iterable $actual, string $message = '')

Assert that the size of two arrays (or Countable or Traversable objects) is the same.

static void
assertNotSameSize(Countable|iterable $expected, Countable|iterable $actual, string $message = '')

Assert that the size of two arrays (or Countable or Traversable objects) is not the same.

static void
assertStringContainsStringIgnoringLineEndings(string $needle, string $haystack, string $message = '')

No description

static void
assertStringEqualsStringIgnoringLineEndings(string $expected, string $actual, string $message = '')

Asserts that two strings are equal except for line endings.

static void
assertFileMatchesFormat(string $format, string $actualFile, string $message = '')

Asserts that a string matches a given format string.

static void
assertFileMatchesFormatFile(string $formatFile, string $actualFile, string $message = '')

Asserts that a string matches a given format string.

static void
assertStringMatchesFormat(string $format, string $string, string $message = '')

Asserts that a string matches a given format string.

static void
assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '')

Asserts that a string matches a given format file.

static void
assertStringStartsWith(string $prefix, string $string, string $message = '')

Asserts that a string starts with a given prefix.

static void
assertStringStartsNotWith(string $prefix, string $string, string $message = '')

Asserts that a string starts not with a given prefix.

static void
assertStringContainsString(string $needle, string $haystack, string $message = '')

No description

static void
assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = '')

No description

static void
assertStringNotContainsString(string $needle, string $haystack, string $message = '')

No description

static void
assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = '')

No description

static void
assertStringEndsWith(string $suffix, string $string, string $message = '')

Asserts that a string ends with a given suffix.

static void
assertStringEndsNotWith(string $suffix, string $string, string $message = '')

Asserts that a string ends not with a given suffix.

static void
assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two XML files are equal.

static void
assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two XML files are not equal.

static void
assertXmlStringEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '')

Asserts that two XML documents are equal.

static void
assertXmlStringNotEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '')

Asserts that two XML documents are not equal.

static void
assertXmlStringEqualsXmlString(string $expectedXml, string $actualXml, string $message = '')

Asserts that two XML documents are equal.

static void
assertXmlStringNotEqualsXmlString(string $expectedXml, string $actualXml, string $message = '')

Asserts that two XML documents are not equal.

static void
assertThat(mixed $value, Constraint $constraint, string $message = '')

Evaluates a PHPUnit\Framework\Constraint matcher object.

static void
assertJson(string $actual, string $message = '')

Asserts that a string is a valid JSON string.

static void
assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '')

Asserts that two given JSON encoded objects or arrays are equal.

static void
assertJsonStringNotEqualsJsonString(string $expectedJson, string $actualJson, string $message = '')

Asserts that two given JSON encoded objects or arrays are not equal.

static void
assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '')

Asserts that the generated JSON encoded object and the content of the given file are equal.

static void
assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '')

Asserts that the generated JSON encoded object and the content of the given file are not equal.

static void
assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two JSON files are equal.

static void
assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two JSON files are not equal.

static LogicalAnd
logicalAnd(mixed ...$constraints)

No description

static LogicalOr
logicalOr(mixed ...$constraints)

No description

static LogicalNot
logicalNot(Constraint $constraint)

No description

static LogicalXor
logicalXor(mixed ...$constraints)

No description

static IsAnything
anything()

No description

static IsTrue
isTrue()

No description

static Callback
callback(callable $callback)

No description

static IsFalse
isFalse()

No description

static IsJson
isJson()

No description

static IsNull
isNull()

No description

static IsFinite
isFinite()

No description

static IsInfinite
isInfinite()

No description

static IsNan
isNan()

No description

containsEqual(mixed $value)

No description

containsIdentical(mixed $value)

No description

containsOnlyArray()

No description

containsOnlyBool()

No description

containsOnlyFloat()

No description

containsOnlyInt()

No description

containsOnlyNull()

No description

containsOnlyNumeric()

No description

containsOnlyObject()

No description

containsOnlyScalar()

No description

containsOnlyString()

No description

containsOnlyInstancesOf(string $className)

No description

static ArrayHasKey
arrayHasKey(mixed $key)

No description

static IsList
isList()

No description

static IsEqual
equalTo(mixed $value)

No description

equalToCanonicalizing(mixed $value)

No description

equalToIgnoringCase(mixed $value)

No description

equalToWithDelta(mixed $value, float $delta)

No description

static IsEmpty
isEmpty()

No description

static IsWritable
isWritable()

No description

static IsReadable
isReadable()

No description

static DirectoryExists
directoryExists()

No description

static FileExists
fileExists()

No description

static GreaterThan
greaterThan(mixed $value)

No description

static LogicalOr
greaterThanOrEqual(mixed $value)

No description

static IsIdentical
identicalTo(mixed $value)

No description

static IsInstanceOf
isInstanceOf(string $className)

No description

static IsType
isArray()

No description

static IsType
isBool()

No description

static IsType
isCallable()

No description

static IsType
isFloat()

No description

static IsType
isInt()

No description

static IsType
isIterable()

No description

static IsType
isNumeric()

No description

static IsType
isObject()

No description

static IsType
isResource()

No description

static IsType
isClosedResource()

No description

static IsType
isScalar()

No description

static IsType
isString()

No description

static LessThan
lessThan(mixed $value)

No description

static LogicalOr
lessThanOrEqual(mixed $value)

No description

matchesRegularExpression(string $pattern)

No description

matches(string $string)

No description

stringStartsWith(string $prefix)

No description

static StringContains
stringContains(string $string, bool $case = true)

No description

static StringEndsWith
stringEndsWith(string $suffix)

No description

static Count
countOf(int $count)

No description

static ObjectEquals
objectEquals(object $object, string $method = 'equals')

No description

static never
fail(string $message = '')

Fails a test with the given message.

static never
markTestIncomplete(string $message = '')

Mark the test as incomplete.

static never
markTestSkipped(string $message = '')

Mark the test as skipped.

static int
getCount()

Return the current assertion count.

static void
resetCount()

Reset the assertion counter.

Details

final static void assertArrayIsEqualToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = '')

Asserts that two arrays are equal while only considering a list of keys.

Parameters

array $expected
array $actual
array $keysToBeConsidered
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertArrayIsEqualToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = '')

Asserts that two arrays are equal while ignoring a list of keys.

Parameters

array $expected
array $actual
array $keysToBeIgnored
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = '')

Asserts that two arrays are identical while only considering a list of keys.

Parameters

array $expected
array $actual
array $keysToBeConsidered
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertArrayIsIdenticalToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = '')

Asserts that two arrays are equal while ignoring a list of keys.

Parameters

array $expected
array $actual
array $keysToBeIgnored
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertArrayHasKey(mixed $key, array|ArrayAccess $array, string $message = '')

Asserts that an array has a specified key.

Parameters

mixed $key
array|ArrayAccess $array
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertArrayNotHasKey(mixed $key, array|ArrayAccess $array, string $message = '')

Asserts that an array does not have a specified key.

Parameters

mixed $key
array|ArrayAccess $array
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsList(mixed $array, string $message = '')

No description

Parameters

mixed $array
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContains(mixed $needle, iterable $haystack, string $message = '')

Asserts that a haystack contains a needle.

Parameters

mixed $needle
iterable $haystack
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertContainsEquals(mixed $needle, iterable $haystack, string $message = '')

No description

Parameters

mixed $needle
iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNotContains(mixed $needle, iterable $haystack, string $message = '')

Asserts that a haystack does not contain a needle.

Parameters

mixed $needle
iterable $haystack
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertNotContainsEquals(mixed $needle, iterable $haystack, string $message = '')

No description

Parameters

mixed $needle
iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyArray(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type array.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyBool(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type bool.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyCallable(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type callable.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyFloat(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type float.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyInt(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type int.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyIterable(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type iterable.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyNull(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type null.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyNumeric(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type numeric.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyObject(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type object.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyResource(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type resource.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyClosedResource(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type closed resource.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyScalar(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type scalar.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyString(iterable $haystack, string $message = '')

Asserts that a haystack contains only values of type string.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = '')

Asserts that a haystack contains only instances of a specified interface or class name.

Parameters

string $className
iterable $haystack
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertContainsNotOnlyArray(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type array.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyBool(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type bool.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyCallable(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type callable.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyFloat(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type float.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyInt(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type int.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyIterable(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type iterable.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyNull(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type null.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyNumeric(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type numeric.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyObject(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type object.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyResource(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type resource.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyClosedResource(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type closed resource.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyScalar(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type scalar.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyString(iterable $haystack, string $message = '')

Asserts that a haystack does not contain only values of type string.

Parameters

iterable $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertContainsNotOnlyInstancesOf(string $className, iterable $haystack, string $message = '')

Asserts that a haystack does not contain only instances of a specified interface or class name.

Parameters

string $className
iterable $haystack
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertCount(int $expectedCount, Countable|iterable $haystack, string $message = '')

Asserts the number of elements of an array, Countable or Traversable.

Parameters

int $expectedCount
Countable|iterable $haystack
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException
GeneratorNotSupportedException

final static void assertNotCount(int $expectedCount, Countable|iterable $haystack, string $message = '')

Asserts the number of elements of an array, Countable or Traversable.

Parameters

int $expectedCount
Countable|iterable $haystack
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException
GeneratorNotSupportedException

final static void assertEquals(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are equal.

Parameters

mixed $expected
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertEqualsCanonicalizing(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are equal (canonicalizing).

Parameters

mixed $expected
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertEqualsIgnoringCase(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are equal (ignoring case).

Parameters

mixed $expected
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertEqualsWithDelta(mixed $expected, mixed $actual, float $delta, string $message = '')

Asserts that two variables are equal (with delta).

Parameters

mixed $expected
mixed $actual
float $delta
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNotEquals(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are not equal.

Parameters

mixed $expected
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNotEqualsCanonicalizing(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are not equal (canonicalizing).

Parameters

mixed $expected
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNotEqualsIgnoringCase(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables are not equal (ignoring case).

Parameters

mixed $expected
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNotEqualsWithDelta(mixed $expected, mixed $actual, float $delta, string $message = '')

Asserts that two variables are not equal (with delta).

Parameters

mixed $expected
mixed $actual
float $delta
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = '')

No description

Parameters

object $expected
object $actual
string $method
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertObjectNotEquals(object $expected, object $actual, string $method = 'equals', string $message = '')

No description

Parameters

object $expected
object $actual
string $method
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertEmpty(mixed $actual, string $message = '')

Asserts that a variable is empty.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException
GeneratorNotSupportedException

final static void assertNotEmpty(mixed $actual, string $message = '')

Asserts that a variable is not empty.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException
GeneratorNotSupportedException

final static void assertGreaterThan(mixed $minimum, mixed $actual, string $message = '')

Asserts that a value is greater than another value.

Parameters

mixed $minimum
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertGreaterThanOrEqual(mixed $minimum, mixed $actual, string $message = '')

Asserts that a value is greater than or equal to another value.

Parameters

mixed $minimum
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertLessThan(mixed $maximum, mixed $actual, string $message = '')

Asserts that a value is smaller than another value.

Parameters

mixed $maximum
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertLessThanOrEqual(mixed $maximum, mixed $actual, string $message = '')

Asserts that a value is smaller than or equal to another value.

Parameters

mixed $maximum
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileEquals(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is equal to the contents of another file.

Parameters

string $expected
string $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is equal to the contents of another file (canonicalizing).

Parameters

string $expected
string $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is equal to the contents of another file (ignoring case).

Parameters

string $expected
string $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileNotEquals(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is not equal to the contents of another file.

Parameters

string $expected
string $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is not equal to the contents of another file (canonicalizing).

Parameters

string $expected
string $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = '')

Asserts that the contents of one file is not equal to the contents of another file (ignoring case).

Parameters

string $expected
string $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is equal to the contents of a file.

Parameters

string $expectedFile
string $actualString
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is equal to the contents of a file (canonicalizing).

Parameters

string $expectedFile
string $actualString
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is equal to the contents of a file (ignoring case).

Parameters

string $expectedFile
string $actualString
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is not equal to the contents of a file.

Parameters

string $expectedFile
string $actualString
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is not equal to the contents of a file (canonicalizing).

Parameters

string $expectedFile
string $actualString
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = '')

Asserts that the contents of a string is not equal to the contents of a file (ignoring case).

Parameters

string $expectedFile
string $actualString
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertIsReadable(string $filename, string $message = '')

Asserts that a file/dir is readable.

Parameters

string $filename
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertIsNotReadable(string $filename, string $message = '')

Asserts that a file/dir exists and is not readable.

Parameters

string $filename
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertIsWritable(string $filename, string $message = '')

Asserts that a file/dir exists and is writable.

Parameters

string $filename
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertIsNotWritable(string $filename, string $message = '')

Asserts that a file/dir exists and is not writable.

Parameters

string $filename
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertDirectoryExists(string $directory, string $message = '')

Asserts that a directory exists.

Parameters

string $directory
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertDirectoryDoesNotExist(string $directory, string $message = '')

Asserts that a directory does not exist.

Parameters

string $directory
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertDirectoryIsReadable(string $directory, string $message = '')

Asserts that a directory exists and is readable.

Parameters

string $directory
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertDirectoryIsNotReadable(string $directory, string $message = '')

Asserts that a directory exists and is not readable.

Parameters

string $directory
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertDirectoryIsWritable(string $directory, string $message = '')

Asserts that a directory exists and is writable.

Parameters

string $directory
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertDirectoryIsNotWritable(string $directory, string $message = '')

Asserts that a directory exists and is not writable.

Parameters

string $directory
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileExists(string $filename, string $message = '')

Asserts that a file exists.

Parameters

string $filename
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileDoesNotExist(string $filename, string $message = '')

Asserts that a file does not exist.

Parameters

string $filename
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileIsReadable(string $file, string $message = '')

Asserts that a file exists and is readable.

Parameters

string $file
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileIsNotReadable(string $file, string $message = '')

Asserts that a file exists and is not readable.

Parameters

string $file
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileIsWritable(string $file, string $message = '')

Asserts that a file exists and is writable.

Parameters

string $file
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileIsNotWritable(string $file, string $message = '')

Asserts that a file exists and is not writable.

Parameters

string $file
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertTrue(mixed $condition, string $message = '')

Asserts that a condition is true.

Parameters

mixed $condition
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNotTrue(mixed $condition, string $message = '')

Asserts that a condition is not true.

Parameters

mixed $condition
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFalse(mixed $condition, string $message = '')

Asserts that a condition is false.

Parameters

mixed $condition
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNotFalse(mixed $condition, string $message = '')

Asserts that a condition is not false.

Parameters

mixed $condition
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNull(mixed $actual, string $message = '')

Asserts that a variable is null.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNotNull(mixed $actual, string $message = '')

Asserts that a variable is not null.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFinite(mixed $actual, string $message = '')

Asserts that a variable is finite.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertInfinite(mixed $actual, string $message = '')

Asserts that a variable is infinite.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNan(mixed $actual, string $message = '')

Asserts that a variable is nan.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertObjectHasProperty(string $propertyName, object $object, string $message = '')

Asserts that an object has a specified property.

Parameters

string $propertyName
object $object
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertObjectNotHasProperty(string $propertyName, object $object, string $message = '')

Asserts that an object does not have a specified property.

Parameters

string $propertyName
object $object
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertSame(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables have the same type and value.

Used on objects, it asserts that two variables reference the same object.

Parameters

mixed $expected
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertNotSame(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables do not have the same type and value.

Used on objects, it asserts that two variables do not reference the same object.

Parameters

mixed $expected
mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertInstanceOf(string $expected, mixed $actual, string $message = '')

Asserts that a variable is of a given type.

Parameters

string $expected
mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException
UnknownClassOrInterfaceException

final static void assertNotInstanceOf(string $expected, mixed $actual, string $message = '')

Asserts that a variable is not of a given type.

Parameters

string $expected
mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsArray(mixed $actual, string $message = '')

Asserts that a variable is of type array.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsBool(mixed $actual, string $message = '')

Asserts that a variable is of type bool.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsFloat(mixed $actual, string $message = '')

Asserts that a variable is of type float.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsInt(mixed $actual, string $message = '')

Asserts that a variable is of type int.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNumeric(mixed $actual, string $message = '')

Asserts that a variable is of type numeric.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsObject(mixed $actual, string $message = '')

Asserts that a variable is of type object.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsResource(mixed $actual, string $message = '')

Asserts that a variable is of type resource.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsClosedResource(mixed $actual, string $message = '')

Asserts that a variable is of type resource and is closed.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsString(mixed $actual, string $message = '')

Asserts that a variable is of type string.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsScalar(mixed $actual, string $message = '')

Asserts that a variable is of type scalar.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsCallable(mixed $actual, string $message = '')

Asserts that a variable is of type callable.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsIterable(mixed $actual, string $message = '')

Asserts that a variable is of type iterable.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotArray(mixed $actual, string $message = '')

Asserts that a variable is not of type array.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotBool(mixed $actual, string $message = '')

Asserts that a variable is not of type bool.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotFloat(mixed $actual, string $message = '')

Asserts that a variable is not of type float.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotInt(mixed $actual, string $message = '')

Asserts that a variable is not of type int.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotNumeric(mixed $actual, string $message = '')

Asserts that a variable is not of type numeric.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotObject(mixed $actual, string $message = '')

Asserts that a variable is not of type object.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotResource(mixed $actual, string $message = '')

Asserts that a variable is not of type resource.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotClosedResource(mixed $actual, string $message = '')

Asserts that a variable is not of type resource.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotString(mixed $actual, string $message = '')

Asserts that a variable is not of type string.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotScalar(mixed $actual, string $message = '')

Asserts that a variable is not of type scalar.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotCallable(mixed $actual, string $message = '')

Asserts that a variable is not of type callable.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertIsNotIterable(mixed $actual, string $message = '')

Asserts that a variable is not of type iterable.

Parameters

mixed $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertMatchesRegularExpression(string $pattern, string $string, string $message = '')

Asserts that a string matches a given regular expression.

Parameters

string $pattern
string $string
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = '')

Asserts that a string does not match a given regular expression.

Parameters

string $pattern
string $string
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertSameSize(Countable|iterable $expected, Countable|iterable $actual, string $message = '')

Assert that the size of two arrays (or Countable or Traversable objects) is the same.

Parameters

Countable|iterable $expected
Countable|iterable $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException
GeneratorNotSupportedException

final static void assertNotSameSize(Countable|iterable $expected, Countable|iterable $actual, string $message = '')

Assert that the size of two arrays (or Countable or Traversable objects) is not the same.

Parameters

Countable|iterable $expected
Countable|iterable $actual
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException
GeneratorNotSupportedException

final static void assertStringContainsStringIgnoringLineEndings(string $needle, string $haystack, string $message = '')

No description

Parameters

string $needle
string $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringEqualsStringIgnoringLineEndings(string $expected, string $actual, string $message = '')

Asserts that two strings are equal except for line endings.

Parameters

string $expected
string $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileMatchesFormat(string $format, string $actualFile, string $message = '')

Asserts that a string matches a given format string.

Parameters

string $format
string $actualFile
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertFileMatchesFormatFile(string $formatFile, string $actualFile, string $message = '')

Asserts that a string matches a given format string.

Parameters

string $formatFile
string $actualFile
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringMatchesFormat(string $format, string $string, string $message = '')

Asserts that a string matches a given format string.

Parameters

string $format
string $string
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '')

Asserts that a string matches a given format file.

Parameters

string $formatFile
string $string
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringStartsWith(string $prefix, string $string, string $message = '')

Asserts that a string starts with a given prefix.

Parameters

string $prefix
string $string
string $message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

final static void assertStringStartsNotWith(string $prefix, string $string, string $message = '')

Asserts that a string starts not with a given prefix.

Parameters

string $prefix
string $string
string $message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

final static void assertStringContainsString(string $needle, string $haystack, string $message = '')

No description

Parameters

string $needle
string $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = '')

No description

Parameters

string $needle
string $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringNotContainsString(string $needle, string $haystack, string $message = '')

No description

Parameters

string $needle
string $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = '')

No description

Parameters

string $needle
string $haystack
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertStringEndsWith(string $suffix, string $string, string $message = '')

Asserts that a string ends with a given suffix.

Parameters

string $suffix
string $string
string $message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

final static void assertStringEndsNotWith(string $suffix, string $string, string $message = '')

Asserts that a string ends not with a given suffix.

Parameters

string $suffix
string $string
string $message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

final static void assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two XML files are equal.

Parameters

string $expectedFile
string $actualFile
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException
XmlException

final static void assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two XML files are not equal.

Parameters

string $expectedFile
string $actualFile
string $message

Return Value

void

Exceptions

Exception
ExpectationFailedException

final static void assertXmlStringEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '')

Asserts that two XML documents are equal.

Parameters

string $expectedFile
string $actualXml
string $message

Return Value

void

Exceptions

ExpectationFailedException
XmlException

final static void assertXmlStringNotEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '')

Asserts that two XML documents are not equal.

Parameters

string $expectedFile
string $actualXml
string $message

Return Value

void

Exceptions

ExpectationFailedException
XmlException

final static void assertXmlStringEqualsXmlString(string $expectedXml, string $actualXml, string $message = '')

Asserts that two XML documents are equal.

Parameters

string $expectedXml
string $actualXml
string $message

Return Value

void

Exceptions

ExpectationFailedException
XmlException

final static void assertXmlStringNotEqualsXmlString(string $expectedXml, string $actualXml, string $message = '')

Asserts that two XML documents are not equal.

Parameters

string $expectedXml
string $actualXml
string $message

Return Value

void

Exceptions

ExpectationFailedException
XmlException

final static void assertThat(mixed $value, Constraint $constraint, string $message = '')

Evaluates a PHPUnit\Framework\Constraint matcher object.

Parameters

mixed $value
Constraint $constraint
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertJson(string $actual, string $message = '')

Asserts that a string is a valid JSON string.

Parameters

string $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '')

Asserts that two given JSON encoded objects or arrays are equal.

Parameters

string $expectedJson
string $actualJson
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertJsonStringNotEqualsJsonString(string $expectedJson, string $actualJson, string $message = '')

Asserts that two given JSON encoded objects or arrays are not equal.

Parameters

string $expectedJson
string $actualJson
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '')

Asserts that the generated JSON encoded object and the content of the given file are equal.

Parameters

string $expectedFile
string $actualJson
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '')

Asserts that the generated JSON encoded object and the content of the given file are not equal.

Parameters

string $expectedFile
string $actualJson
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two JSON files are equal.

Parameters

string $expectedFile
string $actualFile
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static void assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two JSON files are not equal.

Parameters

string $expectedFile
string $actualFile
string $message

Return Value

void

Exceptions

ExpectationFailedException

final static LogicalAnd logicalAnd(mixed ...$constraints)

No description

Parameters

mixed ...$constraints

Return Value

LogicalAnd

Exceptions

Exception

final static LogicalOr logicalOr(mixed ...$constraints)

No description

Parameters

mixed ...$constraints

Return Value

LogicalOr

final static LogicalNot logicalNot(Constraint $constraint)

No description

Parameters

Constraint $constraint

Return Value

LogicalNot

final static LogicalXor logicalXor(mixed ...$constraints)

No description

Parameters

mixed ...$constraints

Return Value

LogicalXor

final static IsAnything anything()

No description

Return Value

IsAnything

final static IsTrue isTrue()

No description

Return Value

IsTrue

final static Callback callback(callable $callback)

No description

Parameters

callable $callback

Return Value

Callback

final static IsFalse isFalse()

No description

Return Value

IsFalse

final static IsJson isJson()

No description

Return Value

IsJson

final static IsNull isNull()

No description

Return Value

IsNull

final static IsFinite isFinite()

No description

Return Value

IsFinite

final static IsInfinite isInfinite()

No description

Return Value

IsInfinite

final static IsNan isNan()

No description

Return Value

IsNan

final static TraversableContainsEqual containsEqual(mixed $value)

No description

Parameters

mixed $value

Return Value

TraversableContainsEqual

final static TraversableContainsIdentical containsIdentical(mixed $value)

No description

Parameters

mixed $value

Return Value

TraversableContainsIdentical

final static TraversableContainsOnly containsOnlyArray()

No description

final static TraversableContainsOnly containsOnlyBool()

No description

final static TraversableContainsOnly containsOnlyCallable()

No description

final static TraversableContainsOnly containsOnlyFloat()

No description

final static TraversableContainsOnly containsOnlyInt()

No description

final static TraversableContainsOnly containsOnlyIterable()

No description

final static TraversableContainsOnly containsOnlyNull()

No description

final static TraversableContainsOnly containsOnlyNumeric()

No description

final static TraversableContainsOnly containsOnlyObject()

No description

final static TraversableContainsOnly containsOnlyResource()

No description

final static TraversableContainsOnly containsOnlyClosedResource()

No description

final static TraversableContainsOnly containsOnlyScalar()

No description

final static TraversableContainsOnly containsOnlyString()

No description

final static TraversableContainsOnly containsOnlyInstancesOf(string $className)

No description

Parameters

string $className

Return Value

TraversableContainsOnly

Exceptions

Exception

final static ArrayHasKey arrayHasKey(mixed $key)

No description

Parameters

mixed $key

Return Value

ArrayHasKey

final static IsList isList()

No description

Return Value

IsList

final static IsEqual equalTo(mixed $value)

No description

Parameters

mixed $value

Return Value

IsEqual

final static IsEqualCanonicalizing equalToCanonicalizing(mixed $value)

No description

Parameters

mixed $value

Return Value

IsEqualCanonicalizing

final static IsEqualIgnoringCase equalToIgnoringCase(mixed $value)

No description

Parameters

mixed $value

Return Value

IsEqualIgnoringCase

final static IsEqualWithDelta equalToWithDelta(mixed $value, float $delta)

No description

Parameters

mixed $value
float $delta

Return Value

IsEqualWithDelta

final static IsEmpty isEmpty()

No description

Return Value

IsEmpty

final static IsWritable isWritable()

No description

Return Value

IsWritable

final static IsReadable isReadable()

No description

Return Value

IsReadable

final static DirectoryExists directoryExists()

No description

Return Value

DirectoryExists

final static FileExists fileExists()

No description

Return Value

FileExists

final static GreaterThan greaterThan(mixed $value)

No description

Parameters

mixed $value

Return Value

GreaterThan

final static LogicalOr greaterThanOrEqual(mixed $value)

No description

Parameters

mixed $value

Return Value

LogicalOr

final static IsIdentical identicalTo(mixed $value)

No description

Parameters

mixed $value

Return Value

IsIdentical

final static IsInstanceOf isInstanceOf(string $className)

No description

Parameters

string $className

Return Value

IsInstanceOf

Exceptions

UnknownClassOrInterfaceException

final static IsType isArray()

No description

Return Value

IsType

final static IsType isBool()

No description

Return Value

IsType

final static IsType isCallable()

No description

Return Value

IsType

final static IsType isFloat()

No description

Return Value

IsType

final static IsType isInt()

No description

Return Value

IsType

final static IsType isIterable()

No description

Return Value

IsType

final static IsType isNumeric()

No description

Return Value

IsType

final static IsType isObject()

No description

Return Value

IsType

final static IsType isResource()

No description

Return Value

IsType

final static IsType isClosedResource()

No description

Return Value

IsType

final static IsType isScalar()

No description

Return Value

IsType

final static IsType isString()

No description

Return Value

IsType

final static LessThan lessThan(mixed $value)

No description

Parameters

mixed $value

Return Value

LessThan

final static LogicalOr lessThanOrEqual(mixed $value)

No description

Parameters

mixed $value

Return Value

LogicalOr

final static RegularExpression matchesRegularExpression(string $pattern)

No description

Parameters

string $pattern

Return Value

RegularExpression

final static StringMatchesFormatDescription matches(string $string)

No description

Parameters

string $string

Return Value

StringMatchesFormatDescription

final static StringStartsWith stringStartsWith(string $prefix)

No description

Parameters

string $prefix

Return Value

StringStartsWith

Exceptions

InvalidArgumentException

final static StringContains stringContains(string $string, bool $case = true)

No description

Parameters

string $string
bool $case

Return Value

StringContains

final static StringEndsWith stringEndsWith(string $suffix)

No description

Parameters

string $suffix

Return Value

StringEndsWith

Exceptions

InvalidArgumentException

final static StringEqualsStringIgnoringLineEndings stringEqualsStringIgnoringLineEndings(string $string)

No description

Parameters

string $string

Return Value

StringEqualsStringIgnoringLineEndings

final static Count countOf(int $count)

No description

Parameters

int $count

Return Value

Count

final static ObjectEquals objectEquals(object $object, string $method = 'equals')

No description

Parameters

object $object
string $method

Return Value

ObjectEquals

final static never fail(string $message = '')

Fails a test with the given message.

Parameters

string $message

Return Value

never

Exceptions

AssertionFailedError

final static never markTestIncomplete(string $message = '')

Mark the test as incomplete.

Parameters

string $message

Return Value

never

Exceptions

IncompleteTestError

final static never markTestSkipped(string $message = '')

Mark the test as skipped.

Parameters

string $message

Return Value

never

Exceptions

SkippedWithMessageException

final static int getCount()

Return the current assertion count.

Return Value

int

final static void resetCount()

Reset the assertion counter.

Return Value

void