Documentation

Framework

Namespaces

Constraint
Error
MockObject

Interfaces, Classes, Traits and Enums

Test
TestListener
This interface, as well as the associated mechanism for extending PHPUnit, will be removed in PHPUnit 10. There is no alternative available in this version of PHPUnit.
Assert
TestCase
TestListenerDefaultImplementation

Table of Contents

assertArrayHasKey()  : void
Asserts that an array has a specified key.
assertArrayNotHasKey()  : void
Asserts that an array does not have a specified key.
assertContains()  : void
Asserts that a haystack contains a needle.
assertContainsEquals()  : void
assertNotContains()  : void
Asserts that a haystack does not contain a needle.
assertNotContainsEquals()  : void
assertContainsOnly()  : void
Asserts that a haystack contains only values of a given type.
assertContainsOnlyInstancesOf()  : void
Asserts that a haystack contains only instances of a given class name.
assertNotContainsOnly()  : void
Asserts that a haystack does not contain only values of a given type.
assertCount()  : void
Asserts the number of elements of an array, Countable or Traversable.
assertNotCount()  : void
Asserts the number of elements of an array, Countable or Traversable.
assertEquals()  : void
Asserts that two variables are equal.
assertEqualsCanonicalizing()  : void
Asserts that two variables are equal (canonicalizing).
assertEqualsIgnoringCase()  : void
Asserts that two variables are equal (ignoring case).
assertEqualsWithDelta()  : void
Asserts that two variables are equal (with delta).
assertNotEquals()  : void
Asserts that two variables are not equal.
assertNotEqualsCanonicalizing()  : void
Asserts that two variables are not equal (canonicalizing).
assertNotEqualsIgnoringCase()  : void
Asserts that two variables are not equal (ignoring case).
assertNotEqualsWithDelta()  : void
Asserts that two variables are not equal (with delta).
assertObjectEquals()  : void
assertEmpty()  : void
Asserts that a variable is empty.
assertNotEmpty()  : void
Asserts that a variable is not empty.
assertGreaterThan()  : void
Asserts that a value is greater than another value.
assertGreaterThanOrEqual()  : void
Asserts that a value is greater than or equal to another value.
assertLessThan()  : void
Asserts that a value is smaller than another value.
assertLessThanOrEqual()  : void
Asserts that a value is smaller than or equal to another value.
assertFileEquals()  : void
Asserts that the contents of one file is equal to the contents of another file.
assertFileEqualsCanonicalizing()  : void
Asserts that the contents of one file is equal to the contents of another file (canonicalizing).
assertFileEqualsIgnoringCase()  : void
Asserts that the contents of one file is equal to the contents of another file (ignoring case).
assertFileNotEquals()  : void
Asserts that the contents of one file is not equal to the contents of another file.
assertFileNotEqualsCanonicalizing()  : void
Asserts that the contents of one file is not equal to the contents of another file (canonicalizing).
assertFileNotEqualsIgnoringCase()  : void
Asserts that the contents of one file is not equal to the contents of another file (ignoring case).
assertStringEqualsFile()  : void
Asserts that the contents of a string is equal to the contents of a file.
assertStringEqualsFileCanonicalizing()  : void
Asserts that the contents of a string is equal to the contents of a file (canonicalizing).
assertStringEqualsFileIgnoringCase()  : void
Asserts that the contents of a string is equal to the contents of a file (ignoring case).
assertStringNotEqualsFile()  : void
Asserts that the contents of a string is not equal to the contents of a file.
assertStringNotEqualsFileCanonicalizing()  : void
Asserts that the contents of a string is not equal to the contents of a file (canonicalizing).
assertStringNotEqualsFileIgnoringCase()  : void
Asserts that the contents of a string is not equal to the contents of a file (ignoring case).
assertIsReadable()  : void
Asserts that a file/dir is readable.
assertIsNotReadable()  : void
Asserts that a file/dir exists and is not readable.
assertNotIsReadable()  : void
Asserts that a file/dir exists and is not readable.
assertIsWritable()  : void
Asserts that a file/dir exists and is writable.
assertIsNotWritable()  : void
Asserts that a file/dir exists and is not writable.
assertNotIsWritable()  : void
Asserts that a file/dir exists and is not writable.
assertDirectoryExists()  : void
Asserts that a directory exists.
assertDirectoryDoesNotExist()  : void
Asserts that a directory does not exist.
assertDirectoryNotExists()  : void
Asserts that a directory does not exist.
assertDirectoryIsReadable()  : void
Asserts that a directory exists and is readable.
assertDirectoryIsNotReadable()  : void
Asserts that a directory exists and is not readable.
assertDirectoryNotIsReadable()  : void
Asserts that a directory exists and is not readable.
assertDirectoryIsWritable()  : void
Asserts that a directory exists and is writable.
assertDirectoryIsNotWritable()  : void
Asserts that a directory exists and is not writable.
assertDirectoryNotIsWritable()  : void
Asserts that a directory exists and is not writable.
assertFileExists()  : void
Asserts that a file exists.
assertFileDoesNotExist()  : void
Asserts that a file does not exist.
assertFileNotExists()  : void
Asserts that a file does not exist.
assertFileIsReadable()  : void
Asserts that a file exists and is readable.
assertFileIsNotReadable()  : void
Asserts that a file exists and is not readable.
assertFileNotIsReadable()  : void
Asserts that a file exists and is not readable.
assertFileIsWritable()  : void
Asserts that a file exists and is writable.
assertFileIsNotWritable()  : void
Asserts that a file exists and is not writable.
assertFileNotIsWritable()  : void
Asserts that a file exists and is not writable.
assertTrue()  : void
Asserts that a condition is true.
assertNotTrue()  : void
Asserts that a condition is not true.
assertFalse()  : void
Asserts that a condition is false.
assertNotFalse()  : void
Asserts that a condition is not false.
assertNull()  : void
Asserts that a variable is null.
assertNotNull()  : void
Asserts that a variable is not null.
assertFinite()  : void
Asserts that a variable is finite.
assertInfinite()  : void
Asserts that a variable is infinite.
assertNan()  : void
Asserts that a variable is nan.
assertClassHasAttribute()  : void
Asserts that a class has a specified attribute.
assertClassNotHasAttribute()  : void
Asserts that a class does not have a specified attribute.
assertClassHasStaticAttribute()  : void
Asserts that a class has a specified static attribute.
assertClassNotHasStaticAttribute()  : void
Asserts that a class does not have a specified static attribute.
assertObjectHasAttribute()  : void
Asserts that an object has a specified attribute.
assertObjectNotHasAttribute()  : void
Asserts that an object does not have a specified attribute.
assertSame()  : void
Asserts that two variables have the same type and value.
assertNotSame()  : void
Asserts that two variables do not have the same type and value.
assertInstanceOf()  : void
Asserts that a variable is of a given type.
assertNotInstanceOf()  : void
Asserts that a variable is not of a given type.
assertIsArray()  : void
Asserts that a variable is of type array.
assertIsBool()  : void
Asserts that a variable is of type bool.
assertIsFloat()  : void
Asserts that a variable is of type float.
assertIsInt()  : void
Asserts that a variable is of type int.
assertIsNumeric()  : void
Asserts that a variable is of type numeric.
assertIsObject()  : void
Asserts that a variable is of type object.
assertIsResource()  : void
Asserts that a variable is of type resource.
assertIsClosedResource()  : void
Asserts that a variable is of type resource and is closed.
assertIsString()  : void
Asserts that a variable is of type string.
assertIsScalar()  : void
Asserts that a variable is of type scalar.
assertIsCallable()  : void
Asserts that a variable is of type callable.
assertIsIterable()  : void
Asserts that a variable is of type iterable.
assertIsNotArray()  : void
Asserts that a variable is not of type array.
assertIsNotBool()  : void
Asserts that a variable is not of type bool.
assertIsNotFloat()  : void
Asserts that a variable is not of type float.
assertIsNotInt()  : void
Asserts that a variable is not of type int.
assertIsNotNumeric()  : void
Asserts that a variable is not of type numeric.
assertIsNotObject()  : void
Asserts that a variable is not of type object.
assertIsNotResource()  : void
Asserts that a variable is not of type resource.
assertIsNotClosedResource()  : void
Asserts that a variable is not of type resource.
assertIsNotString()  : void
Asserts that a variable is not of type string.
assertIsNotScalar()  : void
Asserts that a variable is not of type scalar.
assertIsNotCallable()  : void
Asserts that a variable is not of type callable.
assertIsNotIterable()  : void
Asserts that a variable is not of type iterable.
assertMatchesRegularExpression()  : void
Asserts that a string matches a given regular expression.
assertRegExp()  : void
Asserts that a string matches a given regular expression.
assertDoesNotMatchRegularExpression()  : void
Asserts that a string does not match a given regular expression.
assertNotRegExp()  : void
Asserts that a string does not match a given regular expression.
assertSameSize()  : void
Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same.
assertNotSameSize()  : void
Assert that the size of two arrays (or `Countable` or `Traversable` objects) is not the same.
assertStringMatchesFormat()  : void
Asserts that a string matches a given format string.
assertStringNotMatchesFormat()  : void
Asserts that a string does not match a given format string.
assertStringMatchesFormatFile()  : void
Asserts that a string matches a given format file.
assertStringNotMatchesFormatFile()  : void
Asserts that a string does not match a given format string.
assertStringStartsWith()  : void
Asserts that a string starts with a given prefix.
assertStringStartsNotWith()  : void
Asserts that a string starts not with a given prefix.
assertStringContainsString()  : void
assertStringContainsStringIgnoringCase()  : void
assertStringNotContainsString()  : void
assertStringNotContainsStringIgnoringCase()  : void
assertStringEndsWith()  : void
Asserts that a string ends with a given suffix.
assertStringEndsNotWith()  : void
Asserts that a string ends not with a given suffix.
assertXmlFileEqualsXmlFile()  : void
Asserts that two XML files are equal.
assertXmlFileNotEqualsXmlFile()  : void
Asserts that two XML files are not equal.
assertXmlStringEqualsXmlFile()  : void
Asserts that two XML documents are equal.
assertXmlStringNotEqualsXmlFile()  : void
Asserts that two XML documents are not equal.
assertXmlStringEqualsXmlString()  : void
Asserts that two XML documents are equal.
assertXmlStringNotEqualsXmlString()  : void
Asserts that two XML documents are not equal.
assertEqualXMLStructure()  : void
Asserts that a hierarchy of DOMElements matches.
assertThat()  : void
Evaluates a PHPUnit\Framework\Constraint matcher object.
assertJson()  : void
Asserts that a string is a valid JSON string.
assertJsonStringEqualsJsonString()  : void
Asserts that two given JSON encoded objects or arrays are equal.
assertJsonStringNotEqualsJsonString()  : void
Asserts that two given JSON encoded objects or arrays are not equal.
assertJsonStringEqualsJsonFile()  : void
Asserts that the generated JSON encoded object and the content of the given file are equal.
assertJsonStringNotEqualsJsonFile()  : void
Asserts that the generated JSON encoded object and the content of the given file are not equal.
assertJsonFileEqualsJsonFile()  : void
Asserts that two JSON files are equal.
assertJsonFileNotEqualsJsonFile()  : void
Asserts that two JSON files are not equal.
logicalAnd()  : LogicalAnd
logicalOr()  : LogicalOr
logicalNot()  : LogicalNot
logicalXor()  : LogicalXor
anything()  : IsAnything
isTrue()  : IsTrue
callback()  : Callback
isFalse()  : IsFalse
isJson()  : IsJson
isNull()  : IsNull
isFinite()  : IsFinite
isInfinite()  : IsInfinite
isNan()  : IsNan
containsEqual()  : TraversableContainsEqual
containsIdentical()  : TraversableContainsIdentical
containsOnly()  : TraversableContainsOnly
containsOnlyInstancesOf()  : TraversableContainsOnly
arrayHasKey()  : ArrayHasKey
equalTo()  : IsEqual
equalToCanonicalizing()  : IsEqualCanonicalizing
equalToIgnoringCase()  : IsEqualIgnoringCase
equalToWithDelta()  : IsEqualWithDelta
isEmpty()  : IsEmpty
isWritable()  : IsWritable
isReadable()  : IsReadable
directoryExists()  : DirectoryExists
fileExists()  : FileExists
greaterThan()  : GreaterThan
greaterThanOrEqual()  : LogicalOr
classHasAttribute()  : ClassHasAttribute
classHasStaticAttribute()  : ClassHasStaticAttribute
objectHasAttribute()  : ObjectHasAttribute
identicalTo()  : IsIdentical
isInstanceOf()  : IsInstanceOf
isType()  : IsType
lessThan()  : LessThan
lessThanOrEqual()  : LogicalOr
matchesRegularExpression()  : RegularExpression
matches()  : StringMatchesFormatDescription
stringStartsWith()  : StringStartsWith
stringContains()  : StringContains
stringEndsWith()  : StringEndsWith
countOf()  : Count
objectEquals()  : ObjectEquals
any()  : AnyInvokedCount
Returns a matcher that matches when the method is executed zero or more times.
never()  : InvokedCount
Returns a matcher that matches when the method is never executed.
atLeast()  : InvokedAtLeastCount
Returns a matcher that matches when the method is executed at least N times.
atLeastOnce()  : InvokedAtLeastOnce
Returns a matcher that matches when the method is executed at least once.
once()  : InvokedCount
Returns a matcher that matches when the method is executed exactly once.
exactly()  : InvokedCount
Returns a matcher that matches when the method is executed exactly $count times.
atMost()  : InvokedAtMostCount
Returns a matcher that matches when the method is executed at most N times.
at()  : InvokedAtIndex
Returns a matcher that matches when the method is executed at the given index.
returnValue()  : ReturnStub
returnValueMap()  : ReturnValueMap
returnArgument()  : ReturnArgument
returnCallback()  : ReturnCallback
returnSelf()  : ReturnSelf
Returns the current object.
throwException()  : Exception
onConsecutiveCalls()  : ConsecutiveCalls

Functions

assertArrayHasKey()

Asserts that an array has a specified key.

assertArrayHasKey(int|string $key, array<string|int, mixed>|ArrayAccess $array[, string $message = '' ]) : void
Parameters
$key : int|string
$array : array<string|int, mixed>|ArrayAccess
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertArrayHasKey
Return values
void —

assertArrayNotHasKey()

Asserts that an array does not have a specified key.

assertArrayNotHasKey(int|string $key, array<string|int, mixed>|ArrayAccess $array[, string $message = '' ]) : void
Parameters
$key : int|string
$array : array<string|int, mixed>|ArrayAccess
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertArrayNotHasKey
Return values
void —

assertContains()

Asserts that a haystack contains a needle.

assertContains(mixed $needle, iteratable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
$needle : mixed
$haystack : iteratable<string|int, mixed>
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertContains
Return values
void —

assertContainsEquals()

assertContainsEquals(mixed $needle, iteratable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
$needle : mixed
$haystack : iteratable<string|int, mixed>
$message : string = ''
Return values
void —

assertNotContains()

Asserts that a haystack does not contain a needle.

assertNotContains(mixed $needle, iteratable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
$needle : mixed
$haystack : iteratable<string|int, mixed>
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotContains
Return values
void —

assertNotContainsEquals()

assertNotContainsEquals(mixed $needle, iteratable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
$needle : mixed
$haystack : iteratable<string|int, mixed>
$message : string = ''
Return values
void —

assertContainsOnly()

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

assertContainsOnly(string $type, iteratable<string|int, mixed> $haystack[, bool|null $isNativeType = null ][, string $message = '' ]) : void
Parameters
$type : string
$haystack : iteratable<string|int, mixed>
$isNativeType : bool|null = null
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertContainsOnly
Return values
void —

assertContainsOnlyInstancesOf()

Asserts that a haystack contains only instances of a given class name.

assertContainsOnlyInstancesOf(string $className, iteratable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
$className : string
$haystack : iteratable<string|int, mixed>
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertContainsOnlyInstancesOf
Return values
void —

assertNotContainsOnly()

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

assertNotContainsOnly(string $type, iteratable<string|int, mixed> $haystack[, bool|null $isNativeType = null ][, string $message = '' ]) : void
Parameters
$type : string
$haystack : iteratable<string|int, mixed>
$isNativeType : bool|null = null
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotContainsOnly
Return values
void —

assertCount()

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

assertCount(int $expectedCount, Countable|iteratable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
$expectedCount : int
$haystack : Countable|iteratable<string|int, mixed>
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertCount
Return values
void —

assertNotCount()

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

assertNotCount(int $expectedCount, Countable|iteratable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
$expectedCount : int
$haystack : Countable|iteratable<string|int, mixed>
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotCount
Return values
void —

assertEquals()

Asserts that two variables are equal.

assertEquals(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertEquals
Return values
void —

assertEqualsCanonicalizing()

Asserts that two variables are equal (canonicalizing).

assertEqualsCanonicalizing(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertEqualsCanonicalizing
Return values
void —

assertEqualsIgnoringCase()

Asserts that two variables are equal (ignoring case).

assertEqualsIgnoringCase(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertEqualsIgnoringCase
Return values
void —

assertEqualsWithDelta()

Asserts that two variables are equal (with delta).

assertEqualsWithDelta(mixed $expected, mixed $actual, float $delta[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$delta : float
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertEqualsWithDelta
Return values
void —

assertNotEquals()

Asserts that two variables are not equal.

assertNotEquals(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotEquals
Return values
void —

assertNotEqualsCanonicalizing()

Asserts that two variables are not equal (canonicalizing).

assertNotEqualsCanonicalizing(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotEqualsCanonicalizing
Return values
void —

assertNotEqualsIgnoringCase()

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

assertNotEqualsIgnoringCase(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotEqualsIgnoringCase
Return values
void —

assertNotEqualsWithDelta()

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

assertNotEqualsWithDelta(mixed $expected, mixed $actual, float $delta[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$delta : float
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotEqualsWithDelta
Return values
void —

assertObjectEquals()

assertObjectEquals(object $expected, object $actual[, string $method = 'equals' ][, string $message = '' ]) : void
Parameters
$expected : object
$actual : object
$method : string = 'equals'
$message : string = ''
Tags
throws
ExpectationFailedException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertObjectEquals
Return values
void —

assertEmpty()

Asserts that a variable is empty.

assertEmpty(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

empty $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertEmpty
Return values
void —

assertNotEmpty()

Asserts that a variable is not empty.

assertNotEmpty(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!empty $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotEmpty
Return values
void —

assertGreaterThan()

Asserts that a value is greater than another value.

assertGreaterThan(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertGreaterThan
Return values
void —

assertGreaterThanOrEqual()

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

assertGreaterThanOrEqual(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertGreaterThanOrEqual
Return values
void —

assertLessThan()

Asserts that a value is smaller than another value.

assertLessThan(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertLessThan
Return values
void —

assertLessThanOrEqual()

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

assertLessThanOrEqual(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertLessThanOrEqual
Return values
void —

assertFileEquals()

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

assertFileEquals(string $expected, string $actual[, string $message = '' ]) : void
Parameters
$expected : string
$actual : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileEquals
Return values
void —

assertFileEqualsCanonicalizing()

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

assertFileEqualsCanonicalizing(string $expected, string $actual[, string $message = '' ]) : void
Parameters
$expected : string
$actual : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileEqualsCanonicalizing
Return values
void —

assertFileEqualsIgnoringCase()

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

assertFileEqualsIgnoringCase(string $expected, string $actual[, string $message = '' ]) : void
Parameters
$expected : string
$actual : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileEqualsIgnoringCase
Return values
void —

assertFileNotEquals()

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

assertFileNotEquals(string $expected, string $actual[, string $message = '' ]) : void
Parameters
$expected : string
$actual : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileNotEquals
Return values
void —

assertFileNotEqualsCanonicalizing()

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

assertFileNotEqualsCanonicalizing(string $expected, string $actual[, string $message = '' ]) : void
Parameters
$expected : string
$actual : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileNotEqualsCanonicalizing
Return values
void —

assertFileNotEqualsIgnoringCase()

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

assertFileNotEqualsIgnoringCase(string $expected, string $actual[, string $message = '' ]) : void
Parameters
$expected : string
$actual : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileNotEqualsIgnoringCase
Return values
void —

assertStringEqualsFile()

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

assertStringEqualsFile(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualString : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringEqualsFile
Return values
void —

assertStringEqualsFileCanonicalizing()

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

assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualString : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringEqualsFileCanonicalizing
Return values
void —

assertStringEqualsFileIgnoringCase()

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

assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualString : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringEqualsFileIgnoringCase
Return values
void —

assertStringNotEqualsFile()

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

assertStringNotEqualsFile(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualString : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringNotEqualsFile
Return values
void —

assertStringNotEqualsFileCanonicalizing()

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

assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualString : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringNotEqualsFileCanonicalizing
Return values
void —

assertStringNotEqualsFileIgnoringCase()

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

assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualString : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringNotEqualsFileIgnoringCase
Return values
void —

assertIsReadable()

Asserts that a file/dir is readable.

assertIsReadable(string $filename[, string $message = '' ]) : void
Parameters
$filename : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsReadable
Return values
void —

assertIsNotReadable()

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

assertIsNotReadable(string $filename[, string $message = '' ]) : void
Parameters
$filename : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotReadable
Return values
void —

assertNotIsReadable()

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

assertNotIsReadable(string $filename[, string $message = '' ]) : void
Parameters
$filename : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4062

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotIsReadable
Return values
void —

assertIsWritable()

Asserts that a file/dir exists and is writable.

assertIsWritable(string $filename[, string $message = '' ]) : void
Parameters
$filename : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsWritable
Return values
void —

assertIsNotWritable()

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

assertIsNotWritable(string $filename[, string $message = '' ]) : void
Parameters
$filename : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotWritable
Return values
void —

assertNotIsWritable()

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

assertNotIsWritable(string $filename[, string $message = '' ]) : void
Parameters
$filename : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4065

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotIsWritable
Return values
void —

assertDirectoryExists()

Asserts that a directory exists.

assertDirectoryExists(string $directory[, string $message = '' ]) : void
Parameters
$directory : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDirectoryExists
Return values
void —

assertDirectoryDoesNotExist()

Asserts that a directory does not exist.

assertDirectoryDoesNotExist(string $directory[, string $message = '' ]) : void
Parameters
$directory : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDirectoryDoesNotExist
Return values
void —

assertDirectoryNotExists()

Asserts that a directory does not exist.

assertDirectoryNotExists(string $directory[, string $message = '' ]) : void
Parameters
$directory : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4068

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDirectoryNotExists
Return values
void —

assertDirectoryIsReadable()

Asserts that a directory exists and is readable.

assertDirectoryIsReadable(string $directory[, string $message = '' ]) : void
Parameters
$directory : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDirectoryIsReadable
Return values
void —

assertDirectoryIsNotReadable()

Asserts that a directory exists and is not readable.

assertDirectoryIsNotReadable(string $directory[, string $message = '' ]) : void
Parameters
$directory : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDirectoryIsNotReadable
Return values
void —

assertDirectoryNotIsReadable()

Asserts that a directory exists and is not readable.

assertDirectoryNotIsReadable(string $directory[, string $message = '' ]) : void
Parameters
$directory : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4071

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDirectoryNotIsReadable
Return values
void —

assertDirectoryIsWritable()

Asserts that a directory exists and is writable.

assertDirectoryIsWritable(string $directory[, string $message = '' ]) : void
Parameters
$directory : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDirectoryIsWritable
Return values
void —

assertDirectoryIsNotWritable()

Asserts that a directory exists and is not writable.

assertDirectoryIsNotWritable(string $directory[, string $message = '' ]) : void
Parameters
$directory : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDirectoryIsNotWritable
Return values
void —

assertDirectoryNotIsWritable()

Asserts that a directory exists and is not writable.

assertDirectoryNotIsWritable(string $directory[, string $message = '' ]) : void
Parameters
$directory : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4074

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDirectoryNotIsWritable
Return values
void —

assertFileExists()

Asserts that a file exists.

assertFileExists(string $filename[, string $message = '' ]) : void
Parameters
$filename : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileExists
Return values
void —

assertFileDoesNotExist()

Asserts that a file does not exist.

assertFileDoesNotExist(string $filename[, string $message = '' ]) : void
Parameters
$filename : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileDoesNotExist
Return values
void —

assertFileNotExists()

Asserts that a file does not exist.

assertFileNotExists(string $filename[, string $message = '' ]) : void
Parameters
$filename : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4077

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileNotExists
Return values
void —

assertFileIsReadable()

Asserts that a file exists and is readable.

assertFileIsReadable(string $file[, string $message = '' ]) : void
Parameters
$file : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileIsReadable
Return values
void —

assertFileIsNotReadable()

Asserts that a file exists and is not readable.

assertFileIsNotReadable(string $file[, string $message = '' ]) : void
Parameters
$file : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileIsNotReadable
Return values
void —

assertFileNotIsReadable()

Asserts that a file exists and is not readable.

assertFileNotIsReadable(string $file[, string $message = '' ]) : void
Parameters
$file : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4080

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileNotIsReadable
Return values
void —

assertFileIsWritable()

Asserts that a file exists and is writable.

assertFileIsWritable(string $file[, string $message = '' ]) : void
Parameters
$file : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileIsWritable
Return values
void —

assertFileIsNotWritable()

Asserts that a file exists and is not writable.

assertFileIsNotWritable(string $file[, string $message = '' ]) : void
Parameters
$file : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileIsNotWritable
Return values
void —

assertFileNotIsWritable()

Asserts that a file exists and is not writable.

assertFileNotIsWritable(string $file[, string $message = '' ]) : void
Parameters
$file : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4083

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFileNotIsWritable
Return values
void —

assertTrue()

Asserts that a condition is true.

assertTrue(mixed $condition[, string $message = '' ]) : void
Parameters
$condition : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

true $condition

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertTrue
Return values
void —

assertNotTrue()

Asserts that a condition is not true.

assertNotTrue(mixed $condition[, string $message = '' ]) : void
Parameters
$condition : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!true $condition

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotTrue
Return values
void —

assertFalse()

Asserts that a condition is false.

assertFalse(mixed $condition[, string $message = '' ]) : void
Parameters
$condition : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

false $condition

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFalse
Return values
void —

assertNotFalse()

Asserts that a condition is not false.

assertNotFalse(mixed $condition[, string $message = '' ]) : void
Parameters
$condition : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!false $condition

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotFalse
Return values
void —

assertNull()

Asserts that a variable is null.

assertNull(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

null $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNull
Return values
void —

assertNotNull()

Asserts that a variable is not null.

assertNotNull(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!null $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotNull
Return values
void —

assertFinite()

Asserts that a variable is finite.

assertFinite(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertFinite
Return values
void —

assertInfinite()

Asserts that a variable is infinite.

assertInfinite(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertInfinite
Return values
void —

assertNan()

Asserts that a variable is nan.

assertNan(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNan
Return values
void —

assertClassHasAttribute()

Asserts that a class has a specified attribute.

assertClassHasAttribute(string $attributeName, string $className[, string $message = '' ]) : void
Parameters
$attributeName : string
$className : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertClassHasAttribute
Return values
void —

assertClassNotHasAttribute()

Asserts that a class does not have a specified attribute.

assertClassNotHasAttribute(string $attributeName, string $className[, string $message = '' ]) : void
Parameters
$attributeName : string
$className : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertClassNotHasAttribute
Return values
void —

assertClassHasStaticAttribute()

Asserts that a class has a specified static attribute.

assertClassHasStaticAttribute(string $attributeName, string $className[, string $message = '' ]) : void
Parameters
$attributeName : string
$className : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertClassHasStaticAttribute
Return values
void —

assertClassNotHasStaticAttribute()

Asserts that a class does not have a specified static attribute.

assertClassNotHasStaticAttribute(string $attributeName, string $className[, string $message = '' ]) : void
Parameters
$attributeName : string
$className : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertClassNotHasStaticAttribute
Return values
void —

assertObjectHasAttribute()

Asserts that an object has a specified attribute.

assertObjectHasAttribute(string $attributeName, object $object[, string $message = '' ]) : void
Parameters
$attributeName : string
$object : object
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertObjectHasAttribute
Return values
void —

assertObjectNotHasAttribute()

Asserts that an object does not have a specified attribute.

assertObjectNotHasAttribute(string $attributeName, object $object[, string $message = '' ]) : void
Parameters
$attributeName : string
$object : object
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertObjectNotHasAttribute
Return values
void —

assertSame()

Asserts that two variables have the same type and value.

assertSame(mixed $expected, mixed $actual[, string $message = '' ]) : void

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

Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-template

ExpectedType

psalm-param

ExpectedType $expected

psalm-assert

=ExpectedType $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertSame
Return values
void —

assertNotSame()

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

assertNotSame(mixed $expected, mixed $actual[, string $message = '' ]) : void

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

Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotSame
Return values
void —

assertInstanceOf()

Asserts that a variable is of a given type.

assertInstanceOf(string $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : string
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $expected

psalm-assert

=ExpectedType $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertInstanceOf
Return values
void —

assertNotInstanceOf()

Asserts that a variable is not of a given type.

assertNotInstanceOf(string $expected, mixed $actual[, string $message = '' ]) : void
Parameters
$expected : string
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $expected

psalm-assert

!ExpectedType $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotInstanceOf
Return values
void —

assertIsArray()

Asserts that a variable is of type array.

assertIsArray(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

array $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsArray
Return values
void —

assertIsBool()

Asserts that a variable is of type bool.

assertIsBool(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

bool $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsBool
Return values
void —

assertIsFloat()

Asserts that a variable is of type float.

assertIsFloat(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

float $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsFloat
Return values
void —

assertIsInt()

Asserts that a variable is of type int.

assertIsInt(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

int $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsInt
Return values
void —

assertIsNumeric()

Asserts that a variable is of type numeric.

assertIsNumeric(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

numeric $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNumeric
Return values
void —

assertIsObject()

Asserts that a variable is of type object.

assertIsObject(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

object $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsObject
Return values
void —

assertIsResource()

Asserts that a variable is of type resource.

assertIsResource(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

resource $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsResource
Return values
void —

assertIsClosedResource()

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

assertIsClosedResource(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

resource $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsClosedResource
Return values
void —

assertIsString()

Asserts that a variable is of type string.

assertIsString(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

string $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsString
Return values
void —

assertIsScalar()

Asserts that a variable is of type scalar.

assertIsScalar(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

scalar $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsScalar
Return values
void —

assertIsCallable()

Asserts that a variable is of type callable.

assertIsCallable(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

callable $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsCallable
Return values
void —

assertIsIterable()

Asserts that a variable is of type iterable.

assertIsIterable(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

iterable $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsIterable
Return values
void —

assertIsNotArray()

Asserts that a variable is not of type array.

assertIsNotArray(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!array $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotArray
Return values
void —

assertIsNotBool()

Asserts that a variable is not of type bool.

assertIsNotBool(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!bool $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotBool
Return values
void —

assertIsNotFloat()

Asserts that a variable is not of type float.

assertIsNotFloat(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!float $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotFloat
Return values
void —

assertIsNotInt()

Asserts that a variable is not of type int.

assertIsNotInt(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!int $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotInt
Return values
void —

assertIsNotNumeric()

Asserts that a variable is not of type numeric.

assertIsNotNumeric(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!numeric $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotNumeric
Return values
void —

assertIsNotObject()

Asserts that a variable is not of type object.

assertIsNotObject(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!object $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotObject
Return values
void —

assertIsNotResource()

Asserts that a variable is not of type resource.

assertIsNotResource(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!resource $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotResource
Return values
void —

assertIsNotClosedResource()

Asserts that a variable is not of type resource.

assertIsNotClosedResource(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!resource $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotClosedResource
Return values
void —

assertIsNotString()

Asserts that a variable is not of type string.

assertIsNotString(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!string $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotString
Return values
void —

assertIsNotScalar()

Asserts that a variable is not of type scalar.

assertIsNotScalar(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!scalar $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotScalar
Return values
void —

assertIsNotCallable()

Asserts that a variable is not of type callable.

assertIsNotCallable(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!callable $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotCallable
Return values
void —

assertIsNotIterable()

Asserts that a variable is not of type iterable.

assertIsNotIterable(mixed $actual[, string $message = '' ]) : void
Parameters
$actual : mixed
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
psalm-assert

!iterable $actual

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertIsNotIterable
Return values
void —

assertMatchesRegularExpression()

Asserts that a string matches a given regular expression.

assertMatchesRegularExpression(string $pattern, string $string[, string $message = '' ]) : void
Parameters
$pattern : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertMatchesRegularExpression
Return values
void —

assertRegExp()

Asserts that a string matches a given regular expression.

assertRegExp(string $pattern, string $string[, string $message = '' ]) : void
Parameters
$pattern : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4086

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertRegExp
Return values
void —

assertDoesNotMatchRegularExpression()

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

assertDoesNotMatchRegularExpression(string $pattern, string $string[, string $message = '' ]) : void
Parameters
$pattern : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertDoesNotMatchRegularExpression
Return values
void —

assertNotRegExp()

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

assertNotRegExp(string $pattern, string $string[, string $message = '' ]) : void
Parameters
$pattern : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4089

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotRegExp
Return values
void —

assertSameSize()

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

assertSameSize(Countable|iteratable<string|int, mixed> $expected, Countable|iteratable<string|int, mixed> $actual[, string $message = '' ]) : void
Parameters
$expected : Countable|iteratable<string|int, mixed>
$actual : Countable|iteratable<string|int, mixed>
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertSameSize
Return values
void —

assertNotSameSize()

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

assertNotSameSize(Countable|iteratable<string|int, mixed> $expected, Countable|iteratable<string|int, mixed> $actual[, string $message = '' ]) : void
Parameters
$expected : Countable|iteratable<string|int, mixed>
$actual : Countable|iteratable<string|int, mixed>
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertNotSameSize
Return values
void —

assertStringMatchesFormat()

Asserts that a string matches a given format string.

assertStringMatchesFormat(string $format, string $string[, string $message = '' ]) : void
Parameters
$format : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringMatchesFormat
Return values
void —

assertStringNotMatchesFormat()

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

assertStringNotMatchesFormat(string $format, string $string[, string $message = '' ]) : void
Parameters
$format : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringNotMatchesFormat
Return values
void —

assertStringMatchesFormatFile()

Asserts that a string matches a given format file.

assertStringMatchesFormatFile(string $formatFile, string $string[, string $message = '' ]) : void
Parameters
$formatFile : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringMatchesFormatFile
Return values
void —

assertStringNotMatchesFormatFile()

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

assertStringNotMatchesFormatFile(string $formatFile, string $string[, string $message = '' ]) : void
Parameters
$formatFile : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringNotMatchesFormatFile
Return values
void —

assertStringStartsWith()

Asserts that a string starts with a given prefix.

assertStringStartsWith(string $prefix, string $string[, string $message = '' ]) : void
Parameters
$prefix : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringStartsWith
Return values
void —

assertStringStartsNotWith()

Asserts that a string starts not with a given prefix.

assertStringStartsNotWith(string $prefix, string $string[, string $message = '' ]) : void
Parameters
$prefix : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringStartsNotWith
Return values
void —

assertStringContainsString()

assertStringContainsString(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
$needle : string
$haystack : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringContainsString
Return values
void —

assertStringContainsStringIgnoringCase()

assertStringContainsStringIgnoringCase(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
$needle : string
$haystack : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringContainsStringIgnoringCase
Return values
void —

assertStringNotContainsString()

assertStringNotContainsString(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
$needle : string
$haystack : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringNotContainsString
Return values
void —

assertStringNotContainsStringIgnoringCase()

assertStringNotContainsStringIgnoringCase(string $needle, string $haystack[, string $message = '' ]) : void
Parameters
$needle : string
$haystack : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringNotContainsStringIgnoringCase
Return values
void —

assertStringEndsWith()

Asserts that a string ends with a given suffix.

assertStringEndsWith(string $suffix, string $string[, string $message = '' ]) : void
Parameters
$suffix : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringEndsWith
Return values
void —

assertStringEndsNotWith()

Asserts that a string ends not with a given suffix.

assertStringEndsNotWith(string $suffix, string $string[, string $message = '' ]) : void
Parameters
$suffix : string
$string : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertStringEndsNotWith
Return values
void —

assertXmlFileEqualsXmlFile()

Asserts that two XML files are equal.

assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualFile : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertXmlFileEqualsXmlFile
Return values
void —

assertXmlFileNotEqualsXmlFile()

Asserts that two XML files are not equal.

assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualFile : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertXmlFileNotEqualsXmlFile
Return values
void —

assertXmlStringEqualsXmlFile()

Asserts that two XML documents are equal.

assertXmlStringEqualsXmlFile(string $expectedFile, DOMDocument|string $actualXml[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualXml : DOMDocument|string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertXmlStringEqualsXmlFile
Return values
void —

assertXmlStringNotEqualsXmlFile()

Asserts that two XML documents are not equal.

assertXmlStringNotEqualsXmlFile(string $expectedFile, DOMDocument|string $actualXml[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualXml : DOMDocument|string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertXmlStringNotEqualsXmlFile
Return values
void —

assertXmlStringEqualsXmlString()

Asserts that two XML documents are equal.

assertXmlStringEqualsXmlString(DOMDocument|string $expectedXml, DOMDocument|string $actualXml[, string $message = '' ]) : void
Parameters
$expectedXml : DOMDocument|string
$actualXml : DOMDocument|string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertXmlStringEqualsXmlString
Return values
void —

assertXmlStringNotEqualsXmlString()

Asserts that two XML documents are not equal.

assertXmlStringNotEqualsXmlString(DOMDocument|string $expectedXml, DOMDocument|string $actualXml[, string $message = '' ]) : void
Parameters
$expectedXml : DOMDocument|string
$actualXml : DOMDocument|string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
throws
Exception
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertXmlStringNotEqualsXmlString
Return values
void —

assertEqualXMLStructure()

Asserts that a hierarchy of DOMElements matches.

assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement[, bool $checkAttributes = false ][, string $message = '' ]) : void
Parameters
$expectedElement : DOMElement
$actualElement : DOMElement
$checkAttributes : bool = false
$message : string = ''
Tags
throws
AssertionFailedError
throws
ExpectationFailedException
throws
InvalidArgumentException
codeCoverageIgnore
deprecated

https://github.com/sebastianbergmann/phpunit/issues/4091

no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertEqualXMLStructure
Return values
void —

assertThat()

Evaluates a PHPUnit\Framework\Constraint matcher object.

assertThat(mixed $value, Constraint $constraint[, string $message = '' ]) : void
Parameters
$value : mixed
$constraint : Constraint
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertThat
Return values
void —

assertJson()

Asserts that a string is a valid JSON string.

assertJson(string $actualJson[, string $message = '' ]) : void
Parameters
$actualJson : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertJson
Return values
void —

assertJsonStringEqualsJsonString()

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

assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson[, string $message = '' ]) : void
Parameters
$expectedJson : string
$actualJson : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertJsonStringEqualsJsonString
Return values
void —

assertJsonStringNotEqualsJsonString()

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

assertJsonStringNotEqualsJsonString(string $expectedJson, string $actualJson[, string $message = '' ]) : void
Parameters
$expectedJson : string
$actualJson : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertJsonStringNotEqualsJsonString
Return values
void —

assertJsonStringEqualsJsonFile()

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

assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualJson : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertJsonStringEqualsJsonFile
Return values
void —

assertJsonStringNotEqualsJsonFile()

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

assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualJson : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertJsonStringNotEqualsJsonFile
Return values
void —

assertJsonFileEqualsJsonFile()

Asserts that two JSON files are equal.

assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualFile : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertJsonFileEqualsJsonFile
Return values
void —

assertJsonFileNotEqualsJsonFile()

Asserts that two JSON files are not equal.

assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile[, string $message = '' ]) : void
Parameters
$expectedFile : string
$actualFile : string
$message : string = ''
Tags
throws
ExpectationFailedException
throws
InvalidArgumentException
no-named-arguments

Parameter names are not covered by the backward compatibility promise for PHPUnit

see
Assert::assertJsonFileNotEqualsJsonFile
Return values
void —

objectEquals()

objectEquals(object $object[, string $method = 'equals' ]) : ObjectEquals
Parameters
$object : object
$method : string = 'equals'
Return values
ObjectEquals —

any()

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

any() : AnyInvokedCount
Return values
AnyInvokedCount —

never()

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

never() : InvokedCount
Return values
InvokedCount —

atLeast()

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

atLeast(int $requiredInvocations) : InvokedAtLeastCount
Parameters
$requiredInvocations : int
Return values
InvokedAtLeastCount —

atLeastOnce()

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

atLeastOnce() : InvokedAtLeastOnce
Return values
InvokedAtLeastOnce —

once()

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

once() : InvokedCount
Return values
InvokedCount —

exactly()

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

exactly(int $count) : InvokedCount
Parameters
$count : int
Return values
InvokedCount —

atMost()

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

atMost(int $allowedInvocations) : InvokedAtMostCount
Parameters
$allowedInvocations : int
Return values
InvokedAtMostCount —

at()

Returns a matcher that matches when the method is executed at the given index.

at(int $index) : InvokedAtIndex
Parameters
$index : int
Return values
InvokedAtIndex —

returnValue()

returnValue(mixed $value) : ReturnStub
Parameters
$value : mixed
Return values
ReturnStub —

returnValueMap()

returnValueMap(array<string|int, mixed> $valueMap) : ReturnValueMap
Parameters
$valueMap : array<string|int, mixed>
Return values
ReturnValueMap —

returnArgument()

returnArgument(int $argumentIndex) : ReturnArgument
Parameters
$argumentIndex : int
Return values
ReturnArgument —

returnCallback()

returnCallback(mixed $callback) : ReturnCallback
Parameters
$callback : mixed
Return values
ReturnCallback —

returnSelf()

Returns the current object.

returnSelf() : ReturnSelf

This method is useful when mocking a fluent interface.

Return values
ReturnSelf —

throwException()

throwException(Throwable $exception) : Exception
Parameters
$exception : Throwable
Return values
Exception —

onConsecutiveCalls()

onConsecutiveCalls() : ConsecutiveCalls
Return values
ConsecutiveCalls —

Search results