A set of assertion methods.

Abstract
Methods
public static anything() : PHPUnit\Framework\Constraint\IsAnything
public static arrayHasKey( $key) : PHPUnit\Framework\Constraint\ArrayHasKey
 
    public static assertArrayHasKey( $key, $array, string $message = '') : void
     

    Asserts that an array has a specified key.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertArrayNotHasKey( $key, $array, string $message = '') : void
     

    Asserts that an array does not have a specified key.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertArraySubset( $subset, $array, bool $checkForObjectIdentity = false, string $message = '') : void
     

    Asserts that an array has a specified subset.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • codeCoverageIgnore
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3494
    public static assertAttributeContains( $needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : void
     

    Asserts that a haystack that is stored in a static attribute of a class
    or an attribute of an object contains a needle.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = NULL, string $message = '') : void
     

    Asserts that a haystack that is stored in a static attribute of a class
    or an attribute of an object contains only values of a given type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = '') : void
     

    Asserts the number of elements of an array, Countable or Traversable
    that is stored in an attribute.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = '') : void
     

    Asserts that a static attribute of a class or an attribute of an object
    is empty.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeEquals( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : void
     

    Asserts that a variable is equal to an attribute of an object.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeGreaterThan( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
     

    Asserts that an attribute is greater than another value.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeGreaterThanOrEqual( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
     

    Asserts that an attribute is greater than or equal to another value.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = '') : void
     

    Asserts that an attribute is of a given type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    • psalm-param class-string $expected
    public static assertAttributeInternalType(string $expected, string $attributeName, $classOrObject, string $message = '') : void
     

    Asserts that an attribute is of a given type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeLessThan( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
     

    Asserts that an attribute is smaller than another value.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeLessThanOrEqual( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
     

    Asserts that an attribute is smaller than or equal to another value.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeNotContains( $needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : void
     

    Asserts that a haystack that is stored in a static attribute of a class
    or an attribute of an object does not contain a needle.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeNotContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = NULL, string $message = '') : void
     

    Asserts that a haystack that is stored in a static attribute of a class
    or an attribute of an object does not contain only values of a given
    type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeNotCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = '') : void
     

    Asserts the number of elements of an array, Countable or Traversable
    that is stored in an attribute.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeNotEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = '') : void
     

    Asserts that a static attribute of a class or an attribute of an object
    is not empty.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeNotEquals( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : void
     

    Asserts that a variable is not equal to an attribute of an object.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeNotInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = '') : void
     

    Asserts that an attribute is of a given type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    • psalm-param class-string $expected
    public static assertAttributeNotInternalType(string $expected, string $attributeName, $classOrObject, string $message = '') : void
     

    Asserts that an attribute is of a given type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeNotSame( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
     

    Asserts that a variable and an attribute of an object do not have the
    same type and value.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertAttributeSame( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
     

    Asserts that a variable and an attribute of an object have the same type
    and value.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static assertClassHasAttribute(string $attributeName, string $className, string $message = '') : void
     

    Asserts that a class has a specified attribute.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertClassHasStaticAttribute(string $attributeName, string $className, string $message = '') : void
     

    Asserts that a class has a specified static attribute.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertClassNotHasAttribute(string $attributeName, string $className, string $message = '') : void
     

    Asserts that a class does not have a specified attribute.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertContains( $needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : void
     

    Asserts that a haystack contains a needle.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertContainsEquals( $needle, iterable $haystack, string $message = '') : void
    public static assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = NULL, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertCount(int $expectedCount, $haystack, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertDirectoryExists(string $directory, string $message = '') : void
     

    Asserts that a directory exists.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertDirectoryIsReadable(string $directory, string $message = '') : void
     

    Asserts that a directory exists and is readable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertDirectoryIsWritable(string $directory, string $message = '') : void
     

    Asserts that a directory exists and is writable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertDirectoryNotExists(string $directory, string $message = '') : void
     

    Asserts that a directory does not exist.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertDirectoryNotIsReadable(string $directory, string $message = '') : void
     

    Asserts that a directory exists and is not readable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertDirectoryNotIsWritable(string $directory, string $message = '') : void
     

    Asserts that a directory exists and is not writable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertEmpty( $actual, string $message = '') : void
     

    Asserts that a variable is empty.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert empty $actual
    public static assertEquals( $expected, $actual, string $message = '', float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : void
     

    Asserts that two variables are equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertEqualsCanonicalizing( $expected, $actual, string $message = '') : void
     

    Asserts that two variables are equal (canonicalizing).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertEqualsIgnoringCase( $expected, $actual, string $message = '') : void
     

    Asserts that two variables are equal (ignoring case).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertEqualsWithDelta( $expected, $actual, float $delta, string $message = '') : void
     

    Asserts that two variables are equal (with delta).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = false, string $message = '') : void
     

    Asserts that a hierarchy of DOMElements matches.

    • throws AssertionFailedError
    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFalse( $condition, string $message = '') : void
     

    Asserts that a condition is false.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert false $condition
    public static assertFileEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false) : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static 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).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFileExists(string $filename, string $message = '') : void
     

    Asserts that a file exists.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFileIsReadable(string $file, string $message = '') : void
     

    Asserts that a file exists and is readable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFileIsWritable(string $file, string $message = '') : void
     

    Asserts that a file exists and is writable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFileNotEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false) : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static 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).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static 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).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFileNotExists(string $filename, string $message = '') : void
     

    Asserts that a file does not exist.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFileNotIsReadable(string $file, string $message = '') : void
     

    Asserts that a file exists and is not readable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFileNotIsWritable(string $file, string $message = '') : void
     

    Asserts that a file exists and is not writable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertFinite( $actual, string $message = '') : void
     

    Asserts that a variable is finite.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertGreaterThan( $expected, $actual, string $message = '') : void
     

    Asserts that a value is greater than another value.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertGreaterThanOrEqual( $expected, $actual, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertInfinite( $actual, string $message = '') : void
     

    Asserts that a variable is infinite.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertInstanceOf(string $expected, $actual, string $message = '') : void
     

    Asserts that a variable is of a given type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • psalm-template ExpectedType of object
    • psalm-param class-string $expected
    • psalm-assert ExpectedType $actual
    public static assertInternalType(string $expected, $actual, string $message = '') : void
     

    Asserts that a variable is of a given type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3369
    • codeCoverageIgnore
    public static assertIsArray( $actual, string $message = '') : void
     

    Asserts that a variable is of type array.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert array $actual
    public static assertIsBool( $actual, string $message = '') : void
     

    Asserts that a variable is of type bool.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert bool $actual
    public static assertIsCallable( $actual, string $message = '') : void
     

    Asserts that a variable is of type callable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert callable $actual
    public static assertIsFloat( $actual, string $message = '') : void
     

    Asserts that a variable is of type float.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert float $actual
    public static assertIsInt( $actual, string $message = '') : void
     

    Asserts that a variable is of type int.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert int $actual
    public static assertIsIterable( $actual, string $message = '') : void
     

    Asserts that a variable is of type iterable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert iterable $actual
    public static assertIsNotArray( $actual, string $message = '') : void
     

    Asserts that a variable is not of type array.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !array $actual
    public static assertIsNotBool( $actual, string $message = '') : void
     

    Asserts that a variable is not of type bool.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !bool $actual
    public static assertIsNotCallable( $actual, string $message = '') : void
     

    Asserts that a variable is not of type callable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !callable $actual
    public static assertIsNotFloat( $actual, string $message = '') : void
     

    Asserts that a variable is not of type float.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !float $actual
    public static assertIsNotInt( $actual, string $message = '') : void
     

    Asserts that a variable is not of type int.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !int $actual
    public static assertIsNotIterable( $actual, string $message = '') : void
     

    Asserts that a variable is not of type iterable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !iterable $actual
    public static assertIsNotNumeric( $actual, string $message = '') : void
     

    Asserts that a variable is not of type numeric.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !numeric $actual
    public static assertIsNotObject( $actual, string $message = '') : void
     

    Asserts that a variable is not of type object.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !object $actual
    public static assertIsNotResource( $actual, string $message = '') : void
     

    Asserts that a variable is not of type resource.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !resource $actual
    public static assertIsNotScalar( $actual, string $message = '') : void
     

    Asserts that a variable is not of type scalar.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !scalar $actual
    public static assertIsNotString( $actual, string $message = '') : void
     

    Asserts that a variable is not of type string.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !string $actual
    public static assertIsNumeric( $actual, string $message = '') : void
     

    Asserts that a variable is of type numeric.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert numeric $actual
    public static assertIsObject( $actual, string $message = '') : void
     

    Asserts that a variable is of type object.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert object $actual
    public static assertIsReadable(string $filename, string $message = '') : void
     

    Asserts that a file/dir is readable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertIsResource( $actual, string $message = '') : void
     

    Asserts that a variable is of type resource.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert resource $actual
    public static assertIsScalar( $actual, string $message = '') : void
     

    Asserts that a variable is of type scalar.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert scalar $actual
    public static assertIsString( $actual, string $message = '') : void
     

    Asserts that a variable is of type string.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert string $actual
    public static assertIsWritable(string $filename, string $message = '') : void
     

    Asserts that a file/dir exists and is writable.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertJson(string $actualJson, string $message = '') : void
     

    Asserts that a string is a valid JSON string.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
     

    Asserts that two JSON files are equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
     

    Asserts that two JSON files are not equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static 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.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertJsonStringNotEqualsJsonString( $expectedJson, $actualJson, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertLessThan( $expected, $actual, string $message = '') : void
     

    Asserts that a value is smaller than another value.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertLessThanOrEqual( $expected, $actual, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNan( $actual, string $message = '') : void
     

    Asserts that a variable is nan.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotContains( $needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : void
     

    Asserts that a haystack does not contain a needle.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertNotContainsEquals( $needle, iterable $haystack, string $message = '') : void
    public static assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = NULL, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotCount(int $expectedCount, $haystack, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertNotEmpty( $actual, string $message = '') : void
     

    Asserts that a variable is not empty.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !empty $actual
    public static assertNotEquals( $expected, $actual, string $message = '', $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false) : void
     

    Asserts that two variables are not equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotEqualsCanonicalizing( $expected, $actual, string $message = '') : void
     

    Asserts that two variables are not equal (canonicalizing).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotEqualsIgnoringCase( $expected, $actual, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotEqualsWithDelta( $expected, $actual, float $delta, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotFalse( $condition, string $message = '') : void
     

    Asserts that a condition is not false.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !false $condition
    public static assertNotInstanceOf(string $expected, $actual, string $message = '') : void
     

    Asserts that a variable is not of a given type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    • psalm-template ExpectedType of object
    • psalm-param class-string $expected
    • psalm-assert !ExpectedType $actual
    public static assertNotInternalType(string $expected, $actual, string $message = '') : void
     

    Asserts that a variable is not of a given type.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3369
    • codeCoverageIgnore
    public static assertNotIsReadable(string $filename, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotIsWritable(string $filename, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotNull( $actual, string $message = '') : void
     

    Asserts that a variable is not null.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !null $actual
    public static assertNotRegExp(string $pattern, string $string, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotSame( $expected, $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.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertNotSameSize( $expected, $actual, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertNotTrue( $condition, string $message = '') : void
     

    Asserts that a condition is not true.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert !true $condition
    public static assertNull( $actual, string $message = '') : void
     

    Asserts that a variable is null.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert null $actual
    public static assertObjectHasAttribute(string $attributeName, $object, string $message = '') : void
     

    Asserts that an object has a specified attribute.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertObjectNotHasAttribute(string $attributeName, $object, string $message = '') : void
     

    Asserts that an object does not have a specified attribute.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertRegExp(string $pattern, string $string, string $message = '') : void
     

    Asserts that a string matches a given regular expression.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertSame( $expected, $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.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-template ExpectedType
    • psalm-param ExpectedType $expected
    • psalm-assert =ExpectedType $actual
    public static assertSameSize( $expected, $actual, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertStringContainsString(string $needle, string $haystack, string $message = '') : void
     
    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
     
    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringEndsNotWith(string $suffix, string $string, string $message = '') : void
     

    Asserts that a string ends not with a given suffix.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringEndsWith(string $suffix, string $string, string $message = '') : void
     

    Asserts that a string ends with a given suffix.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false) : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static 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).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringMatchesFormat(string $format, string $string, string $message = '') : void
     

    Asserts that a string matches a given format string.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
     

    Asserts that a string matches a given format file.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringNotContainsString(string $needle, string $haystack, string $message = '') : void
     
    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
     
    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false) : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static 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).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static 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).

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringNotMatchesFormat(string $format, string $string, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
     

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

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringStartsNotWith( $prefix, $string, string $message = '') : void
     

    Asserts that a string starts not with a given prefix.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertStringStartsWith(string $prefix, string $string, string $message = '') : void
     

    Asserts that a string starts with a given prefix.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertThat( $value, PHPUnit\Framework\Constraint\Constraint $constraint, string $message = '') : void
     

    Evaluates a PHPUnit\Framework\Constraint matcher object.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    public static assertTrue( $condition, string $message = '') : void
     

    Asserts that a condition is true.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • psalm-assert true $condition
    public static assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
     

    Asserts that two XML files are equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
     

    Asserts that two XML files are not equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = '') : void
     

    Asserts that two XML documents are equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertXmlStringEqualsXmlString( $expectedXml, $actualXml, string $message = '') : void
     

    Asserts that two XML documents are equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = '') : void
     

    Asserts that two XML documents are not equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static assertXmlStringNotEqualsXmlString( $expectedXml, $actualXml, string $message = '') : void
     

    Asserts that two XML documents are not equal.

    • throws ExpectationFailedException
    • throws SebastianBergmann\RecursionContext\InvalidArgumentException
    • throws Exception
    public static attribute(PHPUnit\Framework\Constraint\Constraint $constraint, string $attributeName) : PHPUnit\Framework\Constraint\Attribute
     
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static attributeEqualTo(string $attributeName, $value, float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : PHPUnit\Framework\Constraint\Attribute
     
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static callback(callable $callback) : PHPUnit\Framework\Constraint\Callback
    public static classHasAttribute(string $attributeName) : PHPUnit\Framework\Constraint\ClassHasAttribute
    public static classHasStaticAttribute(string $attributeName) : PHPUnit\Framework\Constraint\ClassHasStaticAttribute
    public static contains( $value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : PHPUnit\Framework\Constraint\TraversableContains
     
    • deprecated Use containsEqual() or containsIdentical() instead
    public static containsEqual( $value) : PHPUnit\Framework\Constraint\TraversableContainsEqual
    public static containsIdentical( $value) : PHPUnit\Framework\Constraint\TraversableContainsIdentical
    public static containsOnly(string $type) : PHPUnit\Framework\Constraint\TraversableContainsOnly
    public static containsOnlyInstancesOf(string $className) : PHPUnit\Framework\Constraint\TraversableContainsOnly
    public static countOf(int $count) : PHPUnit\Framework\Constraint\Count
    public static directoryExists() : PHPUnit\Framework\Constraint\DirectoryExists
    public static equalTo( $value, float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : PHPUnit\Framework\Constraint\IsEqual
    public static fail(string $message = '') : void
     

    Fails a test with the given message.

    • throws AssertionFailedError
    • psalm-return never-return
    public static fileExists() : PHPUnit\Framework\Constraint\FileExists
    public static getCount() : int
     

    Return the current assertion count.

    public static getObjectAttribute( $object, string $attributeName)
     

    Returns the value of an object's attribute.

    This also works for attributes that are declared protected or private.

    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static getStaticAttribute(string $className, string $attributeName)
     

    Returns the value of a static attribute.

    This also works for attributes that are declared protected or private.

    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static greaterThan( $value) : PHPUnit\Framework\Constraint\GreaterThan
    public static greaterThanOrEqual( $value) : PHPUnit\Framework\Constraint\LogicalOr
    public static identicalTo( $value) : PHPUnit\Framework\Constraint\IsIdentical
    public static isEmpty() : PHPUnit\Framework\Constraint\IsEmpty
    public static isFalse() : PHPUnit\Framework\Constraint\IsFalse
    public static isFinite() : PHPUnit\Framework\Constraint\IsFinite
    public static isInfinite() : PHPUnit\Framework\Constraint\IsInfinite
    public static isInstanceOf(string $className) : PHPUnit\Framework\Constraint\IsInstanceOf
    public static isJson() : PHPUnit\Framework\Constraint\IsJson
    public static isNan() : PHPUnit\Framework\Constraint\IsNan
    public static isNull() : PHPUnit\Framework\Constraint\IsNull
    public static isReadable() : PHPUnit\Framework\Constraint\IsReadable
    public static isTrue() : PHPUnit\Framework\Constraint\IsTrue
    public static isType(string $type) : PHPUnit\Framework\Constraint\IsType
    public static isWritable() : PHPUnit\Framework\Constraint\IsWritable
    public static lessThan( $value) : PHPUnit\Framework\Constraint\LessThan
    public static lessThanOrEqual( $value) : PHPUnit\Framework\Constraint\LogicalOr
    public static logicalAnd() : PHPUnit\Framework\Constraint\LogicalAnd
     
    • throws Exception
    public static logicalNot(PHPUnit\Framework\Constraint\Constraint $constraint) : PHPUnit\Framework\Constraint\LogicalNot
    public static logicalOr() : PHPUnit\Framework\Constraint\LogicalOr
    public static logicalXor() : PHPUnit\Framework\Constraint\LogicalXor
    public static markTestIncomplete(string $message = '') : void
     

    Mark the test as incomplete.

    • throws IncompleteTestError
    public static markTestSkipped(string $message = '') : void
     

    Mark the test as skipped.

    • throws SkippedTestError
    • throws SyntheticSkippedError
    public static matches(string $string) : PHPUnit\Framework\Constraint\StringMatchesFormatDescription
    public static matchesRegularExpression(string $pattern) : PHPUnit\Framework\Constraint\RegularExpression
    public static objectHasAttribute( $attributeName) : PHPUnit\Framework\Constraint\ObjectHasAttribute
    public static readAttribute( $classOrObject, string $attributeName)
     

    Returns the value of an attribute of a class or an object.

    This also works for attributes that are declared protected or private.

    • throws Exception
    • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
    • codeCoverageIgnore
    public static resetCount() : void
     

    Reset the assertion counter.

    public static stringContains(string $string, bool $case = true) : PHPUnit\Framework\Constraint\StringContains
    public static stringEndsWith(string $suffix) : PHPUnit\Framework\Constraint\StringEndsWith
    public static stringStartsWith( $prefix) : PHPUnit\Framework\Constraint\StringStartsWith
    Properties
    private static $count
     
    • var int
    Methods
    private static createWarning(string $warning) : void
     
    • codeCoverageIgnore
    private static detectLocationHint(string $message) : array
    private static isValidClassAttributeName(string $attributeName) : bool
    private static isValidObjectAttributeName(string $attributeName) : bool
    Properties
    private static $count
     
    • var int
    Methods
    public static anything() : PHPUnit\Framework\Constraint\IsAnything
    public static arrayHasKey( $key) : PHPUnit\Framework\Constraint\ArrayHasKey
     
      public static assertArrayHasKey( $key, $array, string $message = '') : void
       

      Asserts that an array has a specified key.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertArrayNotHasKey( $key, $array, string $message = '') : void
       

      Asserts that an array does not have a specified key.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertArraySubset( $subset, $array, bool $checkForObjectIdentity = false, string $message = '') : void
       

      Asserts that an array has a specified subset.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • codeCoverageIgnore
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3494
      public static assertAttributeContains( $needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : void
       

      Asserts that a haystack that is stored in a static attribute of a class
      or an attribute of an object contains a needle.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = NULL, string $message = '') : void
       

      Asserts that a haystack that is stored in a static attribute of a class
      or an attribute of an object contains only values of a given type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = '') : void
       

      Asserts the number of elements of an array, Countable or Traversable
      that is stored in an attribute.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = '') : void
       

      Asserts that a static attribute of a class or an attribute of an object
      is empty.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeEquals( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : void
       

      Asserts that a variable is equal to an attribute of an object.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeGreaterThan( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
       

      Asserts that an attribute is greater than another value.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeGreaterThanOrEqual( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
       

      Asserts that an attribute is greater than or equal to another value.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = '') : void
       

      Asserts that an attribute is of a given type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      • psalm-param class-string $expected
      public static assertAttributeInternalType(string $expected, string $attributeName, $classOrObject, string $message = '') : void
       

      Asserts that an attribute is of a given type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeLessThan( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
       

      Asserts that an attribute is smaller than another value.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeLessThanOrEqual( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
       

      Asserts that an attribute is smaller than or equal to another value.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeNotContains( $needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : void
       

      Asserts that a haystack that is stored in a static attribute of a class
      or an attribute of an object does not contain a needle.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeNotContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = NULL, string $message = '') : void
       

      Asserts that a haystack that is stored in a static attribute of a class
      or an attribute of an object does not contain only values of a given
      type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeNotCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = '') : void
       

      Asserts the number of elements of an array, Countable or Traversable
      that is stored in an attribute.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeNotEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = '') : void
       

      Asserts that a static attribute of a class or an attribute of an object
      is not empty.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeNotEquals( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : void
       

      Asserts that a variable is not equal to an attribute of an object.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeNotInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = '') : void
       

      Asserts that an attribute is of a given type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      • psalm-param class-string $expected
      public static assertAttributeNotInternalType(string $expected, string $attributeName, $classOrObject, string $message = '') : void
       

      Asserts that an attribute is of a given type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeNotSame( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
       

      Asserts that a variable and an attribute of an object do not have the
      same type and value.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertAttributeSame( $expected, string $actualAttributeName, $actualClassOrObject, string $message = '') : void
       

      Asserts that a variable and an attribute of an object have the same type
      and value.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static assertClassHasAttribute(string $attributeName, string $className, string $message = '') : void
       

      Asserts that a class has a specified attribute.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertClassHasStaticAttribute(string $attributeName, string $className, string $message = '') : void
       

      Asserts that a class has a specified static attribute.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertClassNotHasAttribute(string $attributeName, string $className, string $message = '') : void
       

      Asserts that a class does not have a specified attribute.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertContains( $needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : void
       

      Asserts that a haystack contains a needle.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertContainsEquals( $needle, iterable $haystack, string $message = '') : void
      public static assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = NULL, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertCount(int $expectedCount, $haystack, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertDirectoryExists(string $directory, string $message = '') : void
       

      Asserts that a directory exists.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertDirectoryIsReadable(string $directory, string $message = '') : void
       

      Asserts that a directory exists and is readable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertDirectoryIsWritable(string $directory, string $message = '') : void
       

      Asserts that a directory exists and is writable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertDirectoryNotExists(string $directory, string $message = '') : void
       

      Asserts that a directory does not exist.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertDirectoryNotIsReadable(string $directory, string $message = '') : void
       

      Asserts that a directory exists and is not readable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertDirectoryNotIsWritable(string $directory, string $message = '') : void
       

      Asserts that a directory exists and is not writable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertEmpty( $actual, string $message = '') : void
       

      Asserts that a variable is empty.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert empty $actual
      public static assertEquals( $expected, $actual, string $message = '', float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : void
       

      Asserts that two variables are equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertEqualsCanonicalizing( $expected, $actual, string $message = '') : void
       

      Asserts that two variables are equal (canonicalizing).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertEqualsIgnoringCase( $expected, $actual, string $message = '') : void
       

      Asserts that two variables are equal (ignoring case).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertEqualsWithDelta( $expected, $actual, float $delta, string $message = '') : void
       

      Asserts that two variables are equal (with delta).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = false, string $message = '') : void
       

      Asserts that a hierarchy of DOMElements matches.

      • throws AssertionFailedError
      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFalse( $condition, string $message = '') : void
       

      Asserts that a condition is false.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert false $condition
      public static assertFileEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false) : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static 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).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFileExists(string $filename, string $message = '') : void
       

      Asserts that a file exists.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFileIsReadable(string $file, string $message = '') : void
       

      Asserts that a file exists and is readable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFileIsWritable(string $file, string $message = '') : void
       

      Asserts that a file exists and is writable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFileNotEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false) : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static 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).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static 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).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFileNotExists(string $filename, string $message = '') : void
       

      Asserts that a file does not exist.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFileNotIsReadable(string $file, string $message = '') : void
       

      Asserts that a file exists and is not readable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFileNotIsWritable(string $file, string $message = '') : void
       

      Asserts that a file exists and is not writable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertFinite( $actual, string $message = '') : void
       

      Asserts that a variable is finite.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertGreaterThan( $expected, $actual, string $message = '') : void
       

      Asserts that a value is greater than another value.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertGreaterThanOrEqual( $expected, $actual, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertInfinite( $actual, string $message = '') : void
       

      Asserts that a variable is infinite.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertInstanceOf(string $expected, $actual, string $message = '') : void
       

      Asserts that a variable is of a given type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • psalm-template ExpectedType of object
      • psalm-param class-string $expected
      • psalm-assert ExpectedType $actual
      public static assertInternalType(string $expected, $actual, string $message = '') : void
       

      Asserts that a variable is of a given type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3369
      • codeCoverageIgnore
      public static assertIsArray( $actual, string $message = '') : void
       

      Asserts that a variable is of type array.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert array $actual
      public static assertIsBool( $actual, string $message = '') : void
       

      Asserts that a variable is of type bool.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert bool $actual
      public static assertIsCallable( $actual, string $message = '') : void
       

      Asserts that a variable is of type callable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert callable $actual
      public static assertIsFloat( $actual, string $message = '') : void
       

      Asserts that a variable is of type float.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert float $actual
      public static assertIsInt( $actual, string $message = '') : void
       

      Asserts that a variable is of type int.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert int $actual
      public static assertIsIterable( $actual, string $message = '') : void
       

      Asserts that a variable is of type iterable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert iterable $actual
      public static assertIsNotArray( $actual, string $message = '') : void
       

      Asserts that a variable is not of type array.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !array $actual
      public static assertIsNotBool( $actual, string $message = '') : void
       

      Asserts that a variable is not of type bool.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !bool $actual
      public static assertIsNotCallable( $actual, string $message = '') : void
       

      Asserts that a variable is not of type callable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !callable $actual
      public static assertIsNotFloat( $actual, string $message = '') : void
       

      Asserts that a variable is not of type float.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !float $actual
      public static assertIsNotInt( $actual, string $message = '') : void
       

      Asserts that a variable is not of type int.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !int $actual
      public static assertIsNotIterable( $actual, string $message = '') : void
       

      Asserts that a variable is not of type iterable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !iterable $actual
      public static assertIsNotNumeric( $actual, string $message = '') : void
       

      Asserts that a variable is not of type numeric.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !numeric $actual
      public static assertIsNotObject( $actual, string $message = '') : void
       

      Asserts that a variable is not of type object.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !object $actual
      public static assertIsNotResource( $actual, string $message = '') : void
       

      Asserts that a variable is not of type resource.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !resource $actual
      public static assertIsNotScalar( $actual, string $message = '') : void
       

      Asserts that a variable is not of type scalar.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !scalar $actual
      public static assertIsNotString( $actual, string $message = '') : void
       

      Asserts that a variable is not of type string.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !string $actual
      public static assertIsNumeric( $actual, string $message = '') : void
       

      Asserts that a variable is of type numeric.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert numeric $actual
      public static assertIsObject( $actual, string $message = '') : void
       

      Asserts that a variable is of type object.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert object $actual
      public static assertIsReadable(string $filename, string $message = '') : void
       

      Asserts that a file/dir is readable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertIsResource( $actual, string $message = '') : void
       

      Asserts that a variable is of type resource.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert resource $actual
      public static assertIsScalar( $actual, string $message = '') : void
       

      Asserts that a variable is of type scalar.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert scalar $actual
      public static assertIsString( $actual, string $message = '') : void
       

      Asserts that a variable is of type string.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert string $actual
      public static assertIsWritable(string $filename, string $message = '') : void
       

      Asserts that a file/dir exists and is writable.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertJson(string $actualJson, string $message = '') : void
       

      Asserts that a string is a valid JSON string.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
       

      Asserts that two JSON files are equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
       

      Asserts that two JSON files are not equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static 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.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertJsonStringNotEqualsJsonString( $expectedJson, $actualJson, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertLessThan( $expected, $actual, string $message = '') : void
       

      Asserts that a value is smaller than another value.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertLessThanOrEqual( $expected, $actual, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNan( $actual, string $message = '') : void
       

      Asserts that a variable is nan.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotContains( $needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : void
       

      Asserts that a haystack does not contain a needle.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertNotContainsEquals( $needle, iterable $haystack, string $message = '') : void
      public static assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = NULL, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotCount(int $expectedCount, $haystack, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertNotEmpty( $actual, string $message = '') : void
       

      Asserts that a variable is not empty.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !empty $actual
      public static assertNotEquals( $expected, $actual, string $message = '', $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false) : void
       

      Asserts that two variables are not equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotEqualsCanonicalizing( $expected, $actual, string $message = '') : void
       

      Asserts that two variables are not equal (canonicalizing).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotEqualsIgnoringCase( $expected, $actual, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotEqualsWithDelta( $expected, $actual, float $delta, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotFalse( $condition, string $message = '') : void
       

      Asserts that a condition is not false.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !false $condition
      public static assertNotInstanceOf(string $expected, $actual, string $message = '') : void
       

      Asserts that a variable is not of a given type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      • psalm-template ExpectedType of object
      • psalm-param class-string $expected
      • psalm-assert !ExpectedType $actual
      public static assertNotInternalType(string $expected, $actual, string $message = '') : void
       

      Asserts that a variable is not of a given type.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3369
      • codeCoverageIgnore
      public static assertNotIsReadable(string $filename, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotIsWritable(string $filename, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotNull( $actual, string $message = '') : void
       

      Asserts that a variable is not null.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !null $actual
      public static assertNotRegExp(string $pattern, string $string, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotSame( $expected, $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.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertNotSameSize( $expected, $actual, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertNotTrue( $condition, string $message = '') : void
       

      Asserts that a condition is not true.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert !true $condition
      public static assertNull( $actual, string $message = '') : void
       

      Asserts that a variable is null.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert null $actual
      public static assertObjectHasAttribute(string $attributeName, $object, string $message = '') : void
       

      Asserts that an object has a specified attribute.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertObjectNotHasAttribute(string $attributeName, $object, string $message = '') : void
       

      Asserts that an object does not have a specified attribute.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertRegExp(string $pattern, string $string, string $message = '') : void
       

      Asserts that a string matches a given regular expression.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertSame( $expected, $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.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-template ExpectedType
      • psalm-param ExpectedType $expected
      • psalm-assert =ExpectedType $actual
      public static assertSameSize( $expected, $actual, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertStringContainsString(string $needle, string $haystack, string $message = '') : void
       
      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
       
      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringEndsNotWith(string $suffix, string $string, string $message = '') : void
       

      Asserts that a string ends not with a given suffix.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringEndsWith(string $suffix, string $string, string $message = '') : void
       

      Asserts that a string ends with a given suffix.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false) : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static 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).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringMatchesFormat(string $format, string $string, string $message = '') : void
       

      Asserts that a string matches a given format string.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
       

      Asserts that a string matches a given format file.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringNotContainsString(string $needle, string $haystack, string $message = '') : void
       
      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
       
      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false) : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static 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).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static 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).

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringNotMatchesFormat(string $format, string $string, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
       

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

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringStartsNotWith( $prefix, $string, string $message = '') : void
       

      Asserts that a string starts not with a given prefix.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertStringStartsWith(string $prefix, string $string, string $message = '') : void
       

      Asserts that a string starts with a given prefix.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertThat( $value, PHPUnit\Framework\Constraint\Constraint $constraint, string $message = '') : void
       

      Evaluates a PHPUnit\Framework\Constraint matcher object.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      public static assertTrue( $condition, string $message = '') : void
       

      Asserts that a condition is true.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • psalm-assert true $condition
      public static assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
       

      Asserts that two XML files are equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
       

      Asserts that two XML files are not equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = '') : void
       

      Asserts that two XML documents are equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertXmlStringEqualsXmlString( $expectedXml, $actualXml, string $message = '') : void
       

      Asserts that two XML documents are equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = '') : void
       

      Asserts that two XML documents are not equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static assertXmlStringNotEqualsXmlString( $expectedXml, $actualXml, string $message = '') : void
       

      Asserts that two XML documents are not equal.

      • throws ExpectationFailedException
      • throws SebastianBergmann\RecursionContext\InvalidArgumentException
      • throws Exception
      public static attribute(PHPUnit\Framework\Constraint\Constraint $constraint, string $attributeName) : PHPUnit\Framework\Constraint\Attribute
       
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static attributeEqualTo(string $attributeName, $value, float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : PHPUnit\Framework\Constraint\Attribute
       
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static callback(callable $callback) : PHPUnit\Framework\Constraint\Callback
      public static classHasAttribute(string $attributeName) : PHPUnit\Framework\Constraint\ClassHasAttribute
      public static classHasStaticAttribute(string $attributeName) : PHPUnit\Framework\Constraint\ClassHasStaticAttribute
      public static contains( $value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) : PHPUnit\Framework\Constraint\TraversableContains
       
      • deprecated Use containsEqual() or containsIdentical() instead
      public static containsEqual( $value) : PHPUnit\Framework\Constraint\TraversableContainsEqual
      public static containsIdentical( $value) : PHPUnit\Framework\Constraint\TraversableContainsIdentical
      public static containsOnly(string $type) : PHPUnit\Framework\Constraint\TraversableContainsOnly
      public static containsOnlyInstancesOf(string $className) : PHPUnit\Framework\Constraint\TraversableContainsOnly
      public static countOf(int $count) : PHPUnit\Framework\Constraint\Count
      private static createWarning(string $warning) : void
       
      • codeCoverageIgnore
      private static detectLocationHint(string $message) : array
      public static directoryExists() : PHPUnit\Framework\Constraint\DirectoryExists
      public static equalTo( $value, float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) : PHPUnit\Framework\Constraint\IsEqual
      public static fail(string $message = '') : void
       

      Fails a test with the given message.

      • throws AssertionFailedError
      • psalm-return never-return
      public static fileExists() : PHPUnit\Framework\Constraint\FileExists
      public static getCount() : int
       

      Return the current assertion count.

      public static getObjectAttribute( $object, string $attributeName)
       

      Returns the value of an object's attribute.

      This also works for attributes that are declared protected or private.

      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static getStaticAttribute(string $className, string $attributeName)
       

      Returns the value of a static attribute.

      This also works for attributes that are declared protected or private.

      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static greaterThan( $value) : PHPUnit\Framework\Constraint\GreaterThan
      public static greaterThanOrEqual( $value) : PHPUnit\Framework\Constraint\LogicalOr
      public static identicalTo( $value) : PHPUnit\Framework\Constraint\IsIdentical
      public static isEmpty() : PHPUnit\Framework\Constraint\IsEmpty
      public static isFalse() : PHPUnit\Framework\Constraint\IsFalse
      public static isFinite() : PHPUnit\Framework\Constraint\IsFinite
      public static isInfinite() : PHPUnit\Framework\Constraint\IsInfinite
      public static isInstanceOf(string $className) : PHPUnit\Framework\Constraint\IsInstanceOf
      public static isJson() : PHPUnit\Framework\Constraint\IsJson
      public static isNan() : PHPUnit\Framework\Constraint\IsNan
      public static isNull() : PHPUnit\Framework\Constraint\IsNull
      public static isReadable() : PHPUnit\Framework\Constraint\IsReadable
      public static isTrue() : PHPUnit\Framework\Constraint\IsTrue
      public static isType(string $type) : PHPUnit\Framework\Constraint\IsType
      private static isValidClassAttributeName(string $attributeName) : bool
      private static isValidObjectAttributeName(string $attributeName) : bool
      public static isWritable() : PHPUnit\Framework\Constraint\IsWritable
      public static lessThan( $value) : PHPUnit\Framework\Constraint\LessThan
      public static lessThanOrEqual( $value) : PHPUnit\Framework\Constraint\LogicalOr
      public static logicalAnd() : PHPUnit\Framework\Constraint\LogicalAnd
       
      • throws Exception
      public static logicalNot(PHPUnit\Framework\Constraint\Constraint $constraint) : PHPUnit\Framework\Constraint\LogicalNot
      public static logicalOr() : PHPUnit\Framework\Constraint\LogicalOr
      public static logicalXor() : PHPUnit\Framework\Constraint\LogicalXor
      public static markTestIncomplete(string $message = '') : void
       

      Mark the test as incomplete.

      • throws IncompleteTestError
      public static markTestSkipped(string $message = '') : void
       

      Mark the test as skipped.

      • throws SkippedTestError
      • throws SyntheticSkippedError
      public static matches(string $string) : PHPUnit\Framework\Constraint\StringMatchesFormatDescription
      public static matchesRegularExpression(string $pattern) : PHPUnit\Framework\Constraint\RegularExpression
      public static objectHasAttribute( $attributeName) : PHPUnit\Framework\Constraint\ObjectHasAttribute
      public static readAttribute( $classOrObject, string $attributeName)
       

      Returns the value of an attribute of a class or an object.

      This also works for attributes that are declared protected or private.

      • throws Exception
      • deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
      • codeCoverageIgnore
      public static resetCount() : void
       

      Reset the assertion counter.

      public static stringContains(string $string, bool $case = true) : PHPUnit\Framework\Constraint\StringContains
      public static stringEndsWith(string $suffix) : PHPUnit\Framework\Constraint\StringEndsWith
      public static stringStartsWith( $prefix) : PHPUnit\Framework\Constraint\StringStartsWith
      © 2020 Bruce Wells
      Search Namespaces \ Classes
      ConfigurationNumbers (0-9.) only