Assert class abstract

PHPUnit\Framework\Assert

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

Properties #

$count
-

$count

private static int $count = 0

Methods #

anything()
-
arrayHasKey()
-
assertArrayHasKey()
Asserts that an array has a specified key.
assertArrayIsEqualToArrayIgnoringListOfKeys()
Asserts that two arrays are equal while ignoring a list of keys.
assertArrayIsEqualToArrayOnlyConsideringListOfKeys()
Asserts that two arrays are equal while only considering a list of keys.
assertArrayIsIdenticalToArrayIgnoringListOfKeys()
Asserts that two arrays are equal while ignoring a list of keys.
assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys()
Asserts that two arrays are identical while only considering a list of keys.
assertArrayNotHasKey()
Asserts that an array does not have a specified key.
assertContains()
Asserts that a haystack contains a needle.
assertContainsEquals()
-
assertContainsNotOnlyArray()
Asserts that a haystack does not contain only values of type array.
assertContainsNotOnlyBool()
Asserts that a haystack does not contain only values of type bool.
assertContainsNotOnlyCallable()
Asserts that a haystack does not contain only values of type callable.
assertContainsNotOnlyClosedResource()
Asserts that a haystack does not contain only values of type closed resource.
assertContainsNotOnlyFloat()
Asserts that a haystack does not contain only values of type float.
assertContainsNotOnlyInstancesOf()
Asserts that a haystack does not contain only instances of a specified interface or class name.
assertContainsNotOnlyInt()
Asserts that a haystack does not contain only values of type int.
assertContainsNotOnlyIterable()
Asserts that a haystack does not contain only values of type iterable.
assertContainsNotOnlyNull()
Asserts that a haystack does not contain only values of type null.
assertContainsNotOnlyNumeric()
Asserts that a haystack does not contain only values of type numeric.
assertContainsNotOnlyObject()
Asserts that a haystack does not contain only values of type object.
assertContainsNotOnlyResource()
Asserts that a haystack does not contain only values of type resource.
assertContainsNotOnlyScalar()
Asserts that a haystack does not contain only values of type scalar.
assertContainsNotOnlyString()
Asserts that a haystack does not contain only values of type string.
assertContainsOnly()
Asserts that a haystack contains only values of a given type.
assertContainsOnlyArray()
Asserts that a haystack contains only values of type array.
assertContainsOnlyBool()
Asserts that a haystack contains only values of type bool.
assertContainsOnlyCallable()
Asserts that a haystack contains only values of type callable.
assertContainsOnlyClosedResource()
Asserts that a haystack contains only values of type closed resource.
assertContainsOnlyFloat()
Asserts that a haystack contains only values of type float.
assertContainsOnlyInstancesOf()
Asserts that a haystack contains only instances of a specified interface or class name.
assertContainsOnlyInt()
Asserts that a haystack contains only values of type int.
assertContainsOnlyIterable()
Asserts that a haystack contains only values of type iterable.
assertContainsOnlyNull()
Asserts that a haystack contains only values of type null.
assertContainsOnlyNumeric()
Asserts that a haystack contains only values of type numeric.
assertContainsOnlyObject()
Asserts that a haystack contains only values of type object.
assertContainsOnlyResource()
Asserts that a haystack contains only values of type resource.
assertContainsOnlyScalar()
Asserts that a haystack contains only values of type scalar.
assertContainsOnlyString()
Asserts that a haystack contains only values of type string.
assertCount()
Asserts the number of elements of an array, Countable or Traversable.
assertDirectoryDoesNotExist()
Asserts that a directory does not exist.
assertDirectoryExists()
Asserts that a directory exists.
assertDirectoryIsNotReadable()
Asserts that a directory exists and is not readable.
assertDirectoryIsNotWritable()
Asserts that a directory exists and is not writable.
assertDirectoryIsReadable()
Asserts that a directory exists and is readable.
assertDirectoryIsWritable()
Asserts that a directory exists and is writable.
assertDoesNotMatchRegularExpression()
Asserts that a string does not match a given regular expression.
assertEmpty()
Asserts that a variable is empty.
assertEquals()
Asserts that two variables are equal.
assertEqualsCanonicalizing()
Asserts that two variables are equal (canonicalizing).
assertEqualsIgnoringCase()
Asserts that two variables are equal (ignoring case).
assertEqualsWithDelta()
Asserts that two variables are equal (with delta).
assertFalse()
Asserts that a condition is false.
assertFileDoesNotExist()
Asserts that a file does not exist.
assertFileEquals()
Asserts that the contents of one file is equal to the contents of another file.
assertFileEqualsCanonicalizing()
Asserts that the contents of one file is equal to the contents of another file (canonicalizing).
assertFileEqualsIgnoringCase()
Asserts that the contents of one file is equal to the contents of another file (ignoring case).
assertFileExists()
Asserts that a file exists.
assertFileIsNotReadable()
Asserts that a file exists and is not readable.
assertFileIsNotWritable()
Asserts that a file exists and is not writable.
assertFileIsReadable()
Asserts that a file exists and is readable.
assertFileIsWritable()
Asserts that a file exists and is writable.
assertFileMatchesFormat()
Asserts that a string matches a given format string.
assertFileMatchesFormatFile()
Asserts that a string matches a given format string.
assertFileNotEquals()
Asserts that the contents of one file is not equal to the contents of another file.
assertFileNotEqualsCanonicalizing()
Asserts that the contents of one file is not equal to the contents of another file (canonicalizing).
assertFileNotEqualsIgnoringCase()
Asserts that the contents of one file is not equal to the contents of another file (ignoring case).
assertFinite()
Asserts that a variable is finite.
assertGreaterThan()
Asserts that a value is greater than another value.
assertGreaterThanOrEqual()
Asserts that a value is greater than or equal to another value.
assertInfinite()
Asserts that a variable is infinite.
assertInstanceOf()
Asserts that a variable is of a given type.
assertIsArray()
Asserts that a variable is of type array.
assertIsBool()
Asserts that a variable is of type bool.
assertIsCallable()
Asserts that a variable is of type callable.
assertIsClosedResource()
Asserts that a variable is of type resource and is closed.
assertIsFloat()
Asserts that a variable is of type float.
assertIsInt()
Asserts that a variable is of type int.
assertIsIterable()
Asserts that a variable is of type iterable.
assertIsList()
-
assertIsNotArray()
Asserts that a variable is not of type array.
assertIsNotBool()
Asserts that a variable is not of type bool.
assertIsNotCallable()
Asserts that a variable is not of type callable.
assertIsNotClosedResource()
Asserts that a variable is not of type resource.
assertIsNotFloat()
Asserts that a variable is not of type float.
assertIsNotInt()
Asserts that a variable is not of type int.
assertIsNotIterable()
Asserts that a variable is not of type iterable.
assertIsNotNumeric()
Asserts that a variable is not of type numeric.
assertIsNotObject()
Asserts that a variable is not of type object.
assertIsNotReadable()
Asserts that a file/dir exists and is not readable.
assertIsNotResource()
Asserts that a variable is not of type resource.
assertIsNotScalar()
Asserts that a variable is not of type scalar.
assertIsNotString()
Asserts that a variable is not of type string.
assertIsNotWritable()
Asserts that a file/dir exists and is not writable.
assertIsNumeric()
Asserts that a variable is of type numeric.
assertIsObject()
Asserts that a variable is of type object.
assertIsReadable()
Asserts that a file/dir is readable.
assertIsResource()
Asserts that a variable is of type resource.
assertIsScalar()
Asserts that a variable is of type scalar.
assertIsString()
Asserts that a variable is of type string.
assertIsWritable()
Asserts that a file/dir exists and is writable.
assertJson()
Asserts that a string is a valid JSON string.
assertJsonFileEqualsJsonFile()
Asserts that two JSON files are equal.
assertJsonFileNotEqualsJsonFile()
Asserts that two JSON files are not equal.
assertJsonStringEqualsJsonFile()
Asserts that the generated JSON encoded object and the content of the given file are equal.
assertJsonStringEqualsJsonString()
Asserts that two given JSON encoded objects or arrays are equal.
assertJsonStringNotEqualsJsonFile()
Asserts that the generated JSON encoded object and the content of the given file are not equal.
assertJsonStringNotEqualsJsonString()
Asserts that two given JSON encoded objects or arrays are not equal.
assertLessThan()
Asserts that a value is smaller than another value.
assertLessThanOrEqual()
Asserts that a value is smaller than or equal to another value.
assertMatchesRegularExpression()
Asserts that a string matches a given regular expression.
assertNan()
Asserts that a variable is nan.
assertNotContains()
Asserts that a haystack does not contain a needle.
assertNotContainsEquals()
-
assertNotContainsOnly()
Asserts that a haystack does not contain only values of a given type.
assertNotCount()
Asserts the number of elements of an array, Countable or Traversable.
assertNotEmpty()
Asserts that a variable is not empty.
assertNotEquals()
Asserts that two variables are not equal.
assertNotEqualsCanonicalizing()
Asserts that two variables are not equal (canonicalizing).
assertNotEqualsIgnoringCase()
Asserts that two variables are not equal (ignoring case).
assertNotEqualsWithDelta()
Asserts that two variables are not equal (with delta).
assertNotFalse()
Asserts that a condition is not false.
assertNotInstanceOf()
Asserts that a variable is not of a given type.
assertNotNull()
Asserts that a variable is not null.
assertNotSame()
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.
assertNotSameSize()
Assert that the size of two arrays (or `Countable` or `Traversable` objects) is not the same.
assertNotTrue()
Asserts that a condition is not true.
assertNull()
Asserts that a variable is null.
assertObjectEquals()
-
assertObjectHasProperty()
Asserts that an object has a specified property.
assertObjectNotEquals()
-
assertObjectNotHasProperty()
Asserts that an object does not have a specified property.
assertSame()
Asserts that two variables have the same type and value. Used on objects, it asserts that two variables reference the same object.
assertSameSize()
Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same.
assertStringContainsString()
-
assertStringContainsStringIgnoringCase()
-
assertStringContainsStringIgnoringLineEndings()
-
assertStringEndsNotWith()
Asserts that a string ends not with a given suffix.
assertStringEndsWith()
Asserts that a string ends with a given suffix.
assertStringEqualsFile()
Asserts that the contents of a string is equal to the contents of a file.
assertStringEqualsFileCanonicalizing()
Asserts that the contents of a string is equal to the contents of a file (canonicalizing).
assertStringEqualsFileIgnoringCase()
Asserts that the contents of a string is equal to the contents of a file (ignoring case).
assertStringEqualsStringIgnoringLineEndings()
Asserts that two strings are equal except for line endings.
assertStringMatchesFormat()
Asserts that a string matches a given format string.
assertStringMatchesFormatFile()
Asserts that a string matches a given format file.
assertStringNotContainsString()
-
assertStringNotContainsStringIgnoringCase()
-
assertStringNotEqualsFile()
Asserts that the contents of a string is not equal to the contents of a file.
assertStringNotEqualsFileCanonicalizing()
Asserts that the contents of a string is not equal to the contents of a file (canonicalizing).
assertStringNotEqualsFileIgnoringCase()
Asserts that the contents of a string is not equal to the contents of a file (ignoring case).
assertStringNotMatchesFormat()
Asserts that a string does not match a given format string.
assertStringNotMatchesFormatFile()
Asserts that a string does not match a given format string.
assertStringStartsNotWith()
Asserts that a string starts not with a given prefix.
assertStringStartsWith()
Asserts that a string starts with a given prefix.
assertThat()
Evaluates a PHPUnit\Framework\Constraint matcher object.
assertTrue()
Asserts that a condition is true.
assertXmlFileEqualsXmlFile()
Asserts that two XML files are equal.
assertXmlFileNotEqualsXmlFile()
Asserts that two XML files are not equal.
assertXmlStringEqualsXmlFile()
Asserts that two XML documents are equal.
assertXmlStringEqualsXmlString()
Asserts that two XML documents are equal.
assertXmlStringNotEqualsXmlFile()
Asserts that two XML documents are not equal.
assertXmlStringNotEqualsXmlString()
Asserts that two XML documents are not equal.
callback()
-
containsEqual()
-
containsIdentical()
-
containsOnly()
-
containsOnlyArray()
-
containsOnlyBool()
-
containsOnlyCallable()
-
containsOnlyClosedResource()
-
containsOnlyFloat()
-
containsOnlyInstancesOf()
-
containsOnlyInt()
-
containsOnlyIterable()
-
containsOnlyNull()
-
containsOnlyNumeric()
-
containsOnlyObject()
-
containsOnlyResource()
-
containsOnlyScalar()
-
containsOnlyString()
-
countOf()
-
directoryExists()
-
equalTo()
-
equalToCanonicalizing()
-
equalToIgnoringCase()
-
equalToWithDelta()
-
fail()
Fails a test with the given message.
fileExists()
-
getCount()
Return the current assertion count.
greaterThan()
-
greaterThanOrEqual()
-
identicalTo()
-
isArray()
-
isBool()
-
isCallable()
-
isClosedResource()
-
isEmpty()
-
isFalse()
-
isFinite()
-
isFloat()
-
isInfinite()
-
isInstanceOf()
-
isInt()
-
isIterable()
-
isJson()
-
isList()
-
isNan()
-
isNull()
-
isNumeric()
-
isObject()
-
isReadable()
-
isResource()
-
isScalar()
-
isString()
-
isTrue()
-
isType()
-
isWritable()
-
lessThan()
-
lessThanOrEqual()
-
logicalAnd()
-
logicalNot()
-
logicalOr()
-
logicalXor()
-
markTestIncomplete()
Mark the test as incomplete.
markTestSkipped()
Mark the test as skipped.
matches()
-
matchesRegularExpression()
-
objectEquals()
-
resetCount()
Reset the assertion counter.
stringContains()
-
stringEndsWith()
-
stringEqualsStringIgnoringLineEndings()
-
stringStartsWith()
-
isNativeType()
-

anything()

public static final function anything(): \PHPUnit\Framework\Constraint\IsAnything
Returns \PHPUnit\Framework\Constraint\IsAnything

arrayHasKey()

public static final function arrayHasKey(mixed $key): \PHPUnit\Framework\Constraint\ArrayHasKey
Parameters
  • mixed $key
Returns \PHPUnit\Framework\Constraint\ArrayHasKey

assertArrayHasKey()

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

Asserts that an array has a specified key.

Parameters
  • mixed $key
  • ArrayAccess|array $array
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertArrayIsEqualToArrayIgnoringListOfKeys()

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

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

Parameters
  • array $expected
  • array $actual
  • array $keysToBeIgnored
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertArrayIsEqualToArrayOnlyConsideringListOfKeys()

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

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

Parameters
  • array $expected
  • array $actual
  • array $keysToBeConsidered
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertArrayIsIdenticalToArrayIgnoringListOfKeys()

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

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

Parameters
  • array $expected
  • array $actual
  • array $keysToBeIgnored
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys()

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

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

Parameters
  • array $expected
  • array $actual
  • array $keysToBeConsidered
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertArrayNotHasKey()

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

Asserts that an array does not have a specified key.

Parameters
  • mixed $key
  • ArrayAccess|array $array
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertContains()

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

Asserts that a haystack contains a needle.

Parameters
  • mixed $needle
  • iterable $haystack
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertContainsEquals()

public static final function assertContainsEquals(mixed $needle, iterable $haystack, string $message = ''): void
Parameters
  • mixed $needle
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyArray()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyBool()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyCallable()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyClosedResource()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyFloat()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyInstancesOf()

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

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

Parameters
  • string $className
  • iterable $haystack
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertContainsNotOnlyInt()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyIterable()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyNull()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyNumeric()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyObject()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyResource()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyScalar()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsNotOnlyString()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnly()

public static final function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = NULL, string $message = ''): void

Asserts that a haystack contains only values of a given type.

Parameters
  • string $type
  • iterable $haystack
  • ?bool $isNativeType
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertContainsOnlyArray()

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

Asserts that a haystack contains only values of type array.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyBool()

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

Asserts that a haystack contains only values of type bool.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyCallable()

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

Asserts that a haystack contains only values of type callable.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyClosedResource()

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

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

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyFloat()

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

Asserts that a haystack contains only values of type float.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyInstancesOf()

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

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

Parameters
  • string $className
  • iterable $haystack
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertContainsOnlyInt()

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

Asserts that a haystack contains only values of type int.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyIterable()

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

Asserts that a haystack contains only values of type iterable.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyNull()

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

Asserts that a haystack contains only values of type null.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyNumeric()

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

Asserts that a haystack contains only values of type numeric.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyObject()

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

Asserts that a haystack contains only values of type object.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyResource()

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

Asserts that a haystack contains only values of type resource.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyScalar()

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

Asserts that a haystack contains only values of type scalar.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertContainsOnlyString()

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

Asserts that a haystack contains only values of type string.

Parameters
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertCount()

public static final function assertCount(int $expectedCount, Countable|Traversable|array $haystack, string $message = ''): void

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

Parameters
  • int $expectedCount
  • Countable|Traversable|array $haystack
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException
throws
GeneratorNotSupportedException

assertDirectoryDoesNotExist()

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

Asserts that a directory does not exist.

Parameters
  • string $directory
  • string $message
Returns void
throws
ExpectationFailedException

assertDirectoryExists()

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

Asserts that a directory exists.

Parameters
  • string $directory
  • string $message
Returns void
throws
ExpectationFailedException

assertDirectoryIsNotReadable()

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

Asserts that a directory exists and is not readable.

Parameters
  • string $directory
  • string $message
Returns void
throws
ExpectationFailedException

assertDirectoryIsNotWritable()

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

Asserts that a directory exists and is not writable.

Parameters
  • string $directory
  • string $message
Returns void
throws
ExpectationFailedException

assertDirectoryIsReadable()

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

Asserts that a directory exists and is readable.

Parameters
  • string $directory
  • string $message
Returns void
throws
ExpectationFailedException

assertDirectoryIsWritable()

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

Asserts that a directory exists and is writable.

Parameters
  • string $directory
  • string $message
Returns void
throws
ExpectationFailedException

assertDoesNotMatchRegularExpression()

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

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

Parameters
  • string $pattern
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException

assertEmpty()

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

Asserts that a variable is empty.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException
throws
GeneratorNotSupportedException

assertEquals()

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

Asserts that two variables are equal.

Parameters
  • mixed $expected
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertEqualsCanonicalizing()

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

Asserts that two variables are equal (canonicalizing).

Parameters
  • mixed $expected
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertEqualsIgnoringCase()

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

Asserts that two variables are equal (ignoring case).

Parameters
  • mixed $expected
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertEqualsWithDelta()

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

Asserts that two variables are equal (with delta).

Parameters
  • mixed $expected
  • mixed $actual
  • float $delta
  • string $message
Returns void
throws
ExpectationFailedException

assertFalse()

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

Asserts that a condition is false.

Parameters
  • mixed $condition
  • string $message
Returns void
throws
ExpectationFailedException

assertFileDoesNotExist()

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

Asserts that a file does not exist.

Parameters
  • string $filename
  • string $message
Returns void
throws
ExpectationFailedException

assertFileEquals()

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

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

Parameters
  • string $expected
  • string $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertFileEqualsCanonicalizing()

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

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

Parameters
  • string $expected
  • string $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertFileEqualsIgnoringCase()

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

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

Parameters
  • string $expected
  • string $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertFileExists()

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

Asserts that a file exists.

Parameters
  • string $filename
  • string $message
Returns void
throws
ExpectationFailedException

assertFileIsNotReadable()

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

Asserts that a file exists and is not readable.

Parameters
  • string $file
  • string $message
Returns void
throws
ExpectationFailedException

assertFileIsNotWritable()

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

Asserts that a file exists and is not writable.

Parameters
  • string $file
  • string $message
Returns void
throws
ExpectationFailedException

assertFileIsReadable()

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

Asserts that a file exists and is readable.

Parameters
  • string $file
  • string $message
Returns void
throws
ExpectationFailedException

assertFileIsWritable()

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

Asserts that a file exists and is writable.

Parameters
  • string $file
  • string $message
Returns void
throws
ExpectationFailedException

assertFileMatchesFormat()

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

Asserts that a string matches a given format string.

Parameters
  • string $format
  • string $actualFile
  • string $message
Returns void
throws
ExpectationFailedException

assertFileMatchesFormatFile()

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

Asserts that a string matches a given format string.

Parameters
  • string $formatFile
  • string $actualFile
  • string $message
Returns void
throws
ExpectationFailedException

assertFileNotEquals()

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

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

Parameters
  • string $expected
  • string $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertFileNotEqualsCanonicalizing()

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

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

Parameters
  • string $expected
  • string $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertFileNotEqualsIgnoringCase()

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

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
Returns void
throws
ExpectationFailedException

assertFinite()

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

Asserts that a variable is finite.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertGreaterThan()

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

Asserts that a value is greater than another value.

Parameters
  • mixed $minimum
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertGreaterThanOrEqual()

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

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

Parameters
  • mixed $minimum
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertInfinite()

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

Asserts that a variable is infinite.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertInstanceOf()

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

Asserts that a variable is of a given type.

Parameters
  • string $expected
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException
throws
UnknownClassOrInterfaceException

assertIsArray()

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

Asserts that a variable is of type array.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsBool()

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

Asserts that a variable is of type bool.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsCallable()

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

Asserts that a variable is of type callable.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsClosedResource()

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

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

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsFloat()

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

Asserts that a variable is of type float.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsInt()

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

Asserts that a variable is of type int.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsIterable()

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

Asserts that a variable is of type iterable.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsList()

public static final function assertIsList(mixed $array, string $message = ''): void
Parameters
  • mixed $array
  • string $message
Returns void
throws
ExpectationFailedException

assertIsNotArray()

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

Asserts that a variable is not of type array.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotBool()

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

Asserts that a variable is not of type bool.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotCallable()

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

Asserts that a variable is not of type callable.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotClosedResource()

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

Asserts that a variable is not of type resource.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotFloat()

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

Asserts that a variable is not of type float.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotInt()

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

Asserts that a variable is not of type int.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotIterable()

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

Asserts that a variable is not of type iterable.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotNumeric()

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

Asserts that a variable is not of type numeric.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotObject()

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

Asserts that a variable is not of type object.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotReadable()

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

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

Parameters
  • string $filename
  • string $message
Returns void
throws
ExpectationFailedException

assertIsNotResource()

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

Asserts that a variable is not of type resource.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotScalar()

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

Asserts that a variable is not of type scalar.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotString()

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

Asserts that a variable is not of type string.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsNotWritable()

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

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

Parameters
  • string $filename
  • string $message
Returns void
throws
ExpectationFailedException

assertIsNumeric()

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

Asserts that a variable is of type numeric.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsObject()

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

Asserts that a variable is of type object.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsReadable()

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

Asserts that a file/dir is readable.

Parameters
  • string $filename
  • string $message
Returns void
throws
ExpectationFailedException

assertIsResource()

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

Asserts that a variable is of type resource.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsScalar()

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

Asserts that a variable is of type scalar.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsString()

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

Asserts that a variable is of type string.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertIsWritable()

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

Asserts that a file/dir exists and is writable.

Parameters
  • string $filename
  • string $message
Returns void
throws
ExpectationFailedException

assertJson()

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

Asserts that a string is a valid JSON string.

Parameters
  • string $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertJsonFileEqualsJsonFile()

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

Asserts that two JSON files are equal.

Parameters
  • string $expectedFile
  • string $actualFile
  • string $message
Returns void
throws
ExpectationFailedException

assertJsonFileNotEqualsJsonFile()

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

Asserts that two JSON files are not equal.

Parameters
  • string $expectedFile
  • string $actualFile
  • string $message
Returns void
throws
ExpectationFailedException

assertJsonStringEqualsJsonFile()

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

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

Parameters
  • string $expectedFile
  • string $actualJson
  • string $message
Returns void
throws
ExpectationFailedException

assertJsonStringEqualsJsonString()

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

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

Parameters
  • string $expectedJson
  • string $actualJson
  • string $message
Returns void
throws
ExpectationFailedException

assertJsonStringNotEqualsJsonFile()

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

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

Parameters
  • string $expectedFile
  • string $actualJson
  • string $message
Returns void
throws
ExpectationFailedException

assertJsonStringNotEqualsJsonString()

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

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

Parameters
  • string $expectedJson
  • string $actualJson
  • string $message
Returns void
throws
ExpectationFailedException

assertLessThan()

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

Asserts that a value is smaller than another value.

Parameters
  • mixed $maximum
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertLessThanOrEqual()

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

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

Parameters
  • mixed $maximum
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertMatchesRegularExpression()

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

Asserts that a string matches a given regular expression.

Parameters
  • string $pattern
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException

assertNan()

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

Asserts that a variable is nan.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertNotContains()

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

Asserts that a haystack does not contain a needle.

Parameters
  • mixed $needle
  • iterable $haystack
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertNotContainsEquals()

public static final function assertNotContainsEquals(mixed $needle, iterable $haystack, string $message = ''): void
Parameters
  • mixed $needle
  • iterable $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertNotContainsOnly()

public static final function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = NULL, string $message = ''): void

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

Parameters
  • string $type
  • iterable $haystack
  • ?bool $isNativeType
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertNotCount()

public static final function assertNotCount(int $expectedCount, Countable|Traversable|array $haystack, string $message = ''): void

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

Parameters
  • int $expectedCount
  • Countable|Traversable|array $haystack
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException
throws
GeneratorNotSupportedException

assertNotEmpty()

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

Asserts that a variable is not empty.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException
throws
GeneratorNotSupportedException

assertNotEquals()

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

Asserts that two variables are not equal.

Parameters
  • mixed $expected
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertNotEqualsCanonicalizing()

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

Asserts that two variables are not equal (canonicalizing).

Parameters
  • mixed $expected
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertNotEqualsIgnoringCase()

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

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

Parameters
  • mixed $expected
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertNotEqualsWithDelta()

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

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

Parameters
  • mixed $expected
  • mixed $actual
  • float $delta
  • string $message
Returns void
throws
ExpectationFailedException

assertNotFalse()

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

Asserts that a condition is not false.

Parameters
  • mixed $condition
  • string $message
Returns void
throws
ExpectationFailedException

assertNotInstanceOf()

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

Asserts that a variable is not of a given type.

Parameters
  • string $expected
  • mixed $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException

assertNotNull()

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

Asserts that a variable is not null.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertNotSame()

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

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
Returns void
throws
ExpectationFailedException

assertNotSameSize()

public static final function assertNotSameSize(Countable|Traversable|array $expected, Countable|Traversable|array $actual, string $message = ''): void

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

Parameters
  • Countable|Traversable|array $expected
  • Countable|Traversable|array $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException
throws
GeneratorNotSupportedException

assertNotTrue()

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

Asserts that a condition is not true.

Parameters
  • mixed $condition
  • string $message
Returns void
throws
ExpectationFailedException

assertNull()

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

Asserts that a variable is null.

Parameters
  • mixed $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertObjectEquals()

public static final function assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = ''): void
Parameters
  • object $expected
  • object $actual
  • string $method
  • string $message
Returns void
throws
ExpectationFailedException

assertObjectHasProperty()

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

Asserts that an object has a specified property.

Parameters
  • string $propertyName
  • object $object
  • string $message
Returns void
throws
ExpectationFailedException

assertObjectNotEquals()

public static final function assertObjectNotEquals(object $expected, object $actual, string $method = 'equals', string $message = ''): void
Parameters
  • object $expected
  • object $actual
  • string $method
  • string $message
Returns void
throws
ExpectationFailedException

assertObjectNotHasProperty()

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

Asserts that an object does not have a specified property.

Parameters
  • string $propertyName
  • object $object
  • string $message
Returns void
throws
ExpectationFailedException

assertSame()

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

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
Returns void
throws
ExpectationFailedException

assertSameSize()

public static final function assertSameSize(Countable|Traversable|array $expected, Countable|Traversable|array $actual, string $message = ''): void

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

Parameters
  • Countable|Traversable|array $expected
  • Countable|Traversable|array $actual
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException
throws
GeneratorNotSupportedException

assertStringContainsString()

public static final function assertStringContainsString(string $needle, string $haystack, string $message = ''): void
Parameters
  • string $needle
  • string $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertStringContainsStringIgnoringCase()

public static final function assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void
Parameters
  • string $needle
  • string $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertStringContainsStringIgnoringLineEndings()

public static final function assertStringContainsStringIgnoringLineEndings(string $needle, string $haystack, string $message = ''): void
Parameters
  • string $needle
  • string $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertStringEndsNotWith()

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

Asserts that a string ends not with a given suffix.

Parameters
  • string $suffix
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException
throws
InvalidArgumentException

assertStringEndsWith()

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

Asserts that a string ends with a given suffix.

Parameters
  • string $suffix
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException
throws
InvalidArgumentException

assertStringEqualsFile()

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

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

Parameters
  • string $expectedFile
  • string $actualString
  • string $message
Returns void
throws
ExpectationFailedException

assertStringEqualsFileCanonicalizing()

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

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

Parameters
  • string $expectedFile
  • string $actualString
  • string $message
Returns void
throws
ExpectationFailedException

assertStringEqualsFileIgnoringCase()

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

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

Parameters
  • string $expectedFile
  • string $actualString
  • string $message
Returns void
throws
ExpectationFailedException

assertStringEqualsStringIgnoringLineEndings()

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

Asserts that two strings are equal except for line endings.

Parameters
  • string $expected
  • string $actual
  • string $message
Returns void
throws
ExpectationFailedException

assertStringMatchesFormat()

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

Asserts that a string matches a given format string.

Parameters
  • string $format
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException

assertStringMatchesFormatFile()

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

Asserts that a string matches a given format file.

Parameters
  • string $formatFile
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException

assertStringNotContainsString()

public static final function assertStringNotContainsString(string $needle, string $haystack, string $message = ''): void
Parameters
  • string $needle
  • string $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertStringNotContainsStringIgnoringCase()

public static final function assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void
Parameters
  • string $needle
  • string $haystack
  • string $message
Returns void
throws
ExpectationFailedException

assertStringNotEqualsFile()

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

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

Parameters
  • string $expectedFile
  • string $actualString
  • string $message
Returns void
throws
ExpectationFailedException

assertStringNotEqualsFileCanonicalizing()

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

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

Parameters
  • string $expectedFile
  • string $actualString
  • string $message
Returns void
throws
ExpectationFailedException

assertStringNotEqualsFileIgnoringCase()

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

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
Returns void
throws
ExpectationFailedException

assertStringNotMatchesFormat()

public static final function assertStringNotMatchesFormat(string $format, string $string, string $message = ''): void

Asserts that a string does not match a given format string.

Parameters
  • string $format
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException

assertStringNotMatchesFormatFile()

public static final function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = ''): void

Asserts that a string does not match a given format string.

Parameters
  • string $formatFile
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException

assertStringStartsNotWith()

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

Asserts that a string starts not with a given prefix.

Parameters
  • string $prefix
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException
throws
InvalidArgumentException

assertStringStartsWith()

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

Asserts that a string starts with a given prefix.

Parameters
  • string $prefix
  • string $string
  • string $message
Returns void
throws
ExpectationFailedException
throws
InvalidArgumentException

assertThat()

public static final function assertThat(mixed $value, \PHPUnit\Framework\Constraint\Constraint $constraint, string $message = ''): void

Evaluates a PHPUnit\Framework\Constraint matcher object.

Parameters
  • mixed $value
  • \PHPUnit\Framework\Constraint\Constraint $constraint
  • string $message
Returns void
throws
ExpectationFailedException

assertTrue()

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

Asserts that a condition is true.

Parameters
  • mixed $condition
  • string $message
Returns void
throws
ExpectationFailedException

assertXmlFileEqualsXmlFile()

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

Asserts that two XML files are equal.

Parameters
  • string $expectedFile
  • string $actualFile
  • string $message
Returns void
throws
Exception
throws
ExpectationFailedException
throws
XmlException

assertXmlFileNotEqualsXmlFile()

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

Asserts that two XML files are not equal.

Parameters
  • string $expectedFile
  • string $actualFile
  • string $message
Returns void
throws
\PHPUnit\Util\Exception
throws
ExpectationFailedException

assertXmlStringEqualsXmlFile()

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

Asserts that two XML documents are equal.

Parameters
  • string $expectedFile
  • string $actualXml
  • string $message
Returns void
throws
ExpectationFailedException
throws
XmlException

assertXmlStringEqualsXmlString()

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

Asserts that two XML documents are equal.

Parameters
  • string $expectedXml
  • string $actualXml
  • string $message
Returns void
throws
ExpectationFailedException
throws
XmlException

assertXmlStringNotEqualsXmlFile()

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

Asserts that two XML documents are not equal.

Parameters
  • string $expectedFile
  • string $actualXml
  • string $message
Returns void
throws
ExpectationFailedException
throws
XmlException

assertXmlStringNotEqualsXmlString()

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

Asserts that two XML documents are not equal.

Parameters
  • string $expectedXml
  • string $actualXml
  • string $message
Returns void
throws
ExpectationFailedException
throws
XmlException

callback()

public static final function callback(callable $callback): \PHPUnit\Framework\Constraint\Callback
Parameters
  • callable $callback
Returns \PHPUnit\Framework\Constraint\Callback

containsEqual()

public static final function containsEqual(mixed $value): \PHPUnit\Framework\Constraint\TraversableContainsEqual
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\TraversableContainsEqual

containsIdentical()

public static final function containsIdentical(mixed $value): \PHPUnit\Framework\Constraint\TraversableContainsIdentical
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\TraversableContainsIdentical

containsOnly()

public static final function containsOnly(string $type): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Parameters
  • string $type
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly
throws
Exception

containsOnlyArray()

public static final function containsOnlyArray(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyBool()

public static final function containsOnlyBool(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyCallable()

public static final function containsOnlyCallable(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyClosedResource()

public static final function containsOnlyClosedResource(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyFloat()

public static final function containsOnlyFloat(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyInstancesOf()

public static final function containsOnlyInstancesOf(string $className): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Parameters
  • string $className
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly
throws
Exception

containsOnlyInt()

public static final function containsOnlyInt(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyIterable()

public static final function containsOnlyIterable(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyNull()

public static final function containsOnlyNull(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyNumeric()

public static final function containsOnlyNumeric(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyObject()

public static final function containsOnlyObject(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyResource()

public static final function containsOnlyResource(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyScalar()

public static final function containsOnlyScalar(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

containsOnlyString()

public static final function containsOnlyString(): \PHPUnit\Framework\Constraint\TraversableContainsOnly
Returns \PHPUnit\Framework\Constraint\TraversableContainsOnly

countOf()

public static final function countOf(int $count): \PHPUnit\Framework\Constraint\Count
Parameters
  • int $count
Returns \PHPUnit\Framework\Constraint\Count

directoryExists()

public static final function directoryExists(): \PHPUnit\Framework\Constraint\DirectoryExists
Returns \PHPUnit\Framework\Constraint\DirectoryExists

equalTo()

public static final function equalTo(mixed $value): \PHPUnit\Framework\Constraint\IsEqual
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\IsEqual

equalToCanonicalizing()

public static final function equalToCanonicalizing(mixed $value): \PHPUnit\Framework\Constraint\IsEqualCanonicalizing
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\IsEqualCanonicalizing

equalToIgnoringCase()

public static final function equalToIgnoringCase(mixed $value): \PHPUnit\Framework\Constraint\IsEqualIgnoringCase
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\IsEqualIgnoringCase

equalToWithDelta()

public static final function equalToWithDelta(mixed $value, float $delta): \PHPUnit\Framework\Constraint\IsEqualWithDelta
Parameters
  • mixed $value
  • float $delta
Returns \PHPUnit\Framework\Constraint\IsEqualWithDelta

fail()

public static final function fail(string $message = ''): never

Fails a test with the given message.

Parameters
  • string $message
Returns never
throws
AssertionFailedError

fileExists()

public static final function fileExists(): \PHPUnit\Framework\Constraint\FileExists
Returns \PHPUnit\Framework\Constraint\FileExists

getCount()

public static final function getCount(): int

Return the current assertion count.

Returns int

greaterThan()

public static final function greaterThan(mixed $value): \PHPUnit\Framework\Constraint\GreaterThan
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\GreaterThan

greaterThanOrEqual()

public static final function greaterThanOrEqual(mixed $value): \PHPUnit\Framework\Constraint\LogicalOr
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\LogicalOr

identicalTo()

public static final function identicalTo(mixed $value): \PHPUnit\Framework\Constraint\IsIdentical
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\IsIdentical

isArray()

public static final function isArray(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isBool()

public static final function isBool(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isCallable()

public static final function isCallable(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isClosedResource()

public static final function isClosedResource(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isEmpty()

public static final function isEmpty(): \PHPUnit\Framework\Constraint\IsEmpty
Returns \PHPUnit\Framework\Constraint\IsEmpty

isFalse()

public static final function isFalse(): \PHPUnit\Framework\Constraint\IsFalse
Returns \PHPUnit\Framework\Constraint\IsFalse

isFinite()

public static final function isFinite(): \PHPUnit\Framework\Constraint\IsFinite
Returns \PHPUnit\Framework\Constraint\IsFinite

isFloat()

public static final function isFloat(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isInfinite()

public static final function isInfinite(): \PHPUnit\Framework\Constraint\IsInfinite
Returns \PHPUnit\Framework\Constraint\IsInfinite

isInstanceOf()

public static final function isInstanceOf(string $className): \PHPUnit\Framework\Constraint\IsInstanceOf
Parameters
  • string $className
Returns \PHPUnit\Framework\Constraint\IsInstanceOf
throws
UnknownClassOrInterfaceException

isInt()

public static final function isInt(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isIterable()

public static final function isIterable(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isJson()

public static final function isJson(): \PHPUnit\Framework\Constraint\IsJson
Returns \PHPUnit\Framework\Constraint\IsJson

isList()

public static final function isList(): \PHPUnit\Framework\Constraint\IsList
Returns \PHPUnit\Framework\Constraint\IsList

isNan()

public static final function isNan(): \PHPUnit\Framework\Constraint\IsNan
Returns \PHPUnit\Framework\Constraint\IsNan

isNull()

public static final function isNull(): \PHPUnit\Framework\Constraint\IsNull
Returns \PHPUnit\Framework\Constraint\IsNull

isNumeric()

public static final function isNumeric(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isObject()

public static final function isObject(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isReadable()

public static final function isReadable(): \PHPUnit\Framework\Constraint\IsReadable
Returns \PHPUnit\Framework\Constraint\IsReadable

isResource()

public static final function isResource(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isScalar()

public static final function isScalar(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isString()

public static final function isString(): \PHPUnit\Framework\Constraint\IsType
Returns \PHPUnit\Framework\Constraint\IsType

isTrue()

public static final function isTrue(): \PHPUnit\Framework\Constraint\IsTrue
Returns \PHPUnit\Framework\Constraint\IsTrue

isType()

public static final function isType(string $type): \PHPUnit\Framework\Constraint\IsType
Parameters
  • string $type
Returns \PHPUnit\Framework\Constraint\IsType
throws
Exception

isWritable()

public static final function isWritable(): \PHPUnit\Framework\Constraint\IsWritable
Returns \PHPUnit\Framework\Constraint\IsWritable

lessThan()

public static final function lessThan(mixed $value): \PHPUnit\Framework\Constraint\LessThan
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\LessThan

lessThanOrEqual()

public static final function lessThanOrEqual(mixed $value): \PHPUnit\Framework\Constraint\LogicalOr
Parameters
  • mixed $value
Returns \PHPUnit\Framework\Constraint\LogicalOr

logicalAnd()

public static final function logicalAnd(mixed ...$constraints): \PHPUnit\Framework\Constraint\LogicalAnd
Parameters
  • mixed $constraints
Returns \PHPUnit\Framework\Constraint\LogicalAnd
throws
Exception

logicalNot()

public static final function logicalNot(\PHPUnit\Framework\Constraint\Constraint $constraint): \PHPUnit\Framework\Constraint\LogicalNot
Parameters
  • \PHPUnit\Framework\Constraint\Constraint $constraint
Returns \PHPUnit\Framework\Constraint\LogicalNot

logicalOr()

public static final function logicalOr(mixed ...$constraints): \PHPUnit\Framework\Constraint\LogicalOr
Parameters
  • mixed $constraints
Returns \PHPUnit\Framework\Constraint\LogicalOr

logicalXor()

public static final function logicalXor(mixed ...$constraints): \PHPUnit\Framework\Constraint\LogicalXor
Parameters
  • mixed $constraints
Returns \PHPUnit\Framework\Constraint\LogicalXor

markTestIncomplete()

public static final function markTestIncomplete(string $message = ''): never

Mark the test as incomplete.

Parameters
  • string $message
Returns never
throws
IncompleteTestError

markTestSkipped()

public static final function markTestSkipped(string $message = ''): never

Mark the test as skipped.

Parameters
  • string $message
Returns never
throws
SkippedWithMessageException

matches()

public static final function matches(string $string): \PHPUnit\Framework\Constraint\StringMatchesFormatDescription
Parameters
  • string $string
Returns \PHPUnit\Framework\Constraint\StringMatchesFormatDescription

matchesRegularExpression()

public static final function matchesRegularExpression(string $pattern): \PHPUnit\Framework\Constraint\RegularExpression
Parameters
  • string $pattern
Returns \PHPUnit\Framework\Constraint\RegularExpression

objectEquals()

public static final function objectEquals(object $object, string $method = 'equals'): \PHPUnit\Framework\Constraint\ObjectEquals
Parameters
  • object $object
  • string $method
Returns \PHPUnit\Framework\Constraint\ObjectEquals

resetCount()

public static final function resetCount(): void

Reset the assertion counter.

Returns void

stringContains()

public static final function stringContains(string $string, bool $case = true): \PHPUnit\Framework\Constraint\StringContains
Parameters
  • string $string
  • bool $case
Returns \PHPUnit\Framework\Constraint\StringContains

stringEndsWith()

public static final function stringEndsWith(string $suffix): \PHPUnit\Framework\Constraint\StringEndsWith
Parameters
  • string $suffix
Returns \PHPUnit\Framework\Constraint\StringEndsWith
throws
InvalidArgumentException

stringEqualsStringIgnoringLineEndings()

public static final function stringEqualsStringIgnoringLineEndings(string $string): \PHPUnit\Framework\Constraint\StringEqualsStringIgnoringLineEndings
Parameters
  • string $string
Returns \PHPUnit\Framework\Constraint\StringEqualsStringIgnoringLineEndings

stringStartsWith()

public static final function stringStartsWith(string $prefix): \PHPUnit\Framework\Constraint\StringStartsWith
Parameters
  • string $prefix
Returns \PHPUnit\Framework\Constraint\StringStartsWith
throws
InvalidArgumentException

isNativeType()

private static function isNativeType(string $type): bool
Parameters
  • string $type
Returns bool