Copied!
Abstract
  • Extends
    PHPUnit\Framework\Assert
    PHPUnit\Framework\TestCase
  • Implements
    Countable
    PHPUnit\Framework\Reorderable
    PHPUnit\Framework\SelfDescribing
    PHPUnit\Framework\Test
Methods
public PHPUnit\Framework\TestCase::__construct(string $name)
 
  • psalm-param non-empty-string $name
  • internal This method is not covered by the backward compatibility promise for PHPUnit
  • final
public final PHPUnit\Framework\TestCase::addToAssertionCount(int $count) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::anything() : PHPUnit\Framework\Constraint\IsAnything
public final static PHPUnit\Framework\Assert::arrayHasKey(string|int $key) : PHPUnit\Framework\Constraint\ArrayHasKey
public final static PHPUnit\Framework\Assert::assertArrayHasKey(string|int $key, ArrayAccess|array $array, string $message = '') : void
 

Asserts that an array has a specified key.

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayIsEqualToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = '') : void
 

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

  • psalm-param non-empty-list<array-key> $keysToBeIgnored
  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayIsEqualToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = '') : void
 

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

  • psalm-param non-empty-list<array-key> $keysToBeConsidered
  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayIsIdenticalToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = '') : void
 

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

  • psalm-param non-empty-list<array-key> $keysToBeIgnored
  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = '') : void
 

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

  • psalm-param non-empty-list<array-key> $keysToBeConsidered
  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayNotHasKey(string|int $key, ArrayAccess|array $array, string $message = '') : void
 

Asserts that an array does not have a specified key.

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertContains(?mixed $needle, iterable $haystack, string $message = '') : void
 

Asserts that a haystack contains a needle.

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertContainsEquals(?mixed $needle, iterable $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = NULL, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertCount(int $expectedCount, Countable|Traversable|array $haystack, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
public final static PHPUnit\Framework\Assert::assertDirectoryDoesNotExist(string $directory, string $message = '') : void
 

Asserts that a directory does not exist.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryExists(string $directory, string $message = '') : void
 

Asserts that a directory exists.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryIsNotReadable(string $directory, string $message = '') : void
 

Asserts that a directory exists and is not readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryIsNotWritable(string $directory, string $message = '') : void
 

Asserts that a directory exists and is not writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryIsReadable(string $directory, string $message = '') : void
 

Asserts that a directory exists and is readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryIsWritable(string $directory, string $message = '') : void
 

Asserts that a directory exists and is writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertEmpty(?mixed $actual, string $message = '') : void
 

Asserts that a variable is empty.

  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
  • psalm-assert empty $actual
public final static PHPUnit\Framework\Assert::assertEquals(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are equal.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertEqualsCanonicalizing(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are equal (canonicalizing).

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertEqualsIgnoringCase(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are equal (ignoring case).

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertEqualsWithDelta(?mixed $expected, ?mixed $actual, float $delta, string $message = '') : void
 

Asserts that two variables are equal (with delta).

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFalse(?mixed $condition, string $message = '') : void
 

Asserts that a condition is false.

  • throws \ExpectationFailedException
  • psalm-assert false $condition
public final static PHPUnit\Framework\Assert::assertFileDoesNotExist(string $filename, string $message = '') : void
 

Asserts that a file does not exist.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileEquals(string $expected, string $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertFileExists(string $filename, string $message = '') : void
 

Asserts that a file exists.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileIsNotReadable(string $file, string $message = '') : void
 

Asserts that a file exists and is not readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileIsNotWritable(string $file, string $message = '') : void
 

Asserts that a file exists and is not writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileIsReadable(string $file, string $message = '') : void
 

Asserts that a file exists and is readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileIsWritable(string $file, string $message = '') : void
 

Asserts that a file exists and is writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileMatchesFormat(string $format, string $actualFile, string $message = '') : void
 

Asserts that a string matches a given format string.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileMatchesFormatFile(string $formatFile, string $actualFile, string $message = '') : void
 

Asserts that a string matches a given format string.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileNotEquals(string $expected, string $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertFinite(?mixed $actual, string $message = '') : void
 

Asserts that a variable is finite.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertGreaterThan(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that a value is greater than another value.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertGreaterThanOrEqual(?mixed $expected, ?mixed $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertInfinite(?mixed $actual, string $message = '') : void
 

Asserts that a variable is infinite.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertInstanceOf(string $expected, ?mixed $actual, string $message = '') : void
 

Asserts that a variable is of a given type.

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \UnknownClassOrInterfaceException
  • psalm-template ExpectedType of object
  • psalm-param class-string<ExpectedType> $expected
  • psalm-assert =ExpectedType $actual
public final static PHPUnit\Framework\Assert::assertIsArray(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type array.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert array $actual
public final static PHPUnit\Framework\Assert::assertIsBool(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type bool.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert bool $actual
public final static PHPUnit\Framework\Assert::assertIsCallable(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type callable.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert callable $actual
public final static PHPUnit\Framework\Assert::assertIsClosedResource(?mixed $actual, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert resource $actual
public final static PHPUnit\Framework\Assert::assertIsFloat(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type float.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert float $actual
public final static PHPUnit\Framework\Assert::assertIsInt(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type int.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert int $actual
public final static PHPUnit\Framework\Assert::assertIsIterable(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type iterable.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert iterable $actual
public final static PHPUnit\Framework\Assert::assertIsList(?mixed $array, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertIsNotArray(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type array.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !array $actual
public final static PHPUnit\Framework\Assert::assertIsNotBool(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type bool.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !bool $actual
public final static PHPUnit\Framework\Assert::assertIsNotCallable(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type callable.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !callable $actual
public final static PHPUnit\Framework\Assert::assertIsNotClosedResource(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type resource.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !resource $actual
public final static PHPUnit\Framework\Assert::assertIsNotFloat(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type float.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !float $actual
public final static PHPUnit\Framework\Assert::assertIsNotInt(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type int.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !int $actual
public final static PHPUnit\Framework\Assert::assertIsNotIterable(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type iterable.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !iterable $actual
public final static PHPUnit\Framework\Assert::assertIsNotNumeric(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type numeric.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !numeric $actual
public final static PHPUnit\Framework\Assert::assertIsNotObject(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type object.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !object $actual
public final static PHPUnit\Framework\Assert::assertIsNotReadable(string $filename, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertIsNotResource(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type resource.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !resource $actual
public final static PHPUnit\Framework\Assert::assertIsNotScalar(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type scalar.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !scalar $actual
public final static PHPUnit\Framework\Assert::assertIsNotString(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type string.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !string $actual
public final static PHPUnit\Framework\Assert::assertIsNotWritable(string $filename, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertIsNumeric(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type numeric.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert numeric $actual
public final static PHPUnit\Framework\Assert::assertIsObject(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type object.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert object $actual
public final static PHPUnit\Framework\Assert::assertIsReadable(string $filename, string $message = '') : void
 

Asserts that a file/dir is readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertIsResource(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type resource.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert resource $actual
public final static PHPUnit\Framework\Assert::assertIsScalar(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type scalar.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert scalar $actual
public final static PHPUnit\Framework\Assert::assertIsString(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type string.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert string $actual
public final static PHPUnit\Framework\Assert::assertIsWritable(string $filename, string $message = '') : void
 

Asserts that a file/dir exists and is writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertJson(string $actual, string $message = '') : void
 

Asserts that a string is a valid JSON string.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
 

Asserts that two JSON files are equal.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
 

Asserts that two JSON files are not equal.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertJsonStringNotEqualsJsonString(string $expectedJson, string $actualJson, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertLessThan(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that a value is smaller than another value.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertLessThanOrEqual(?mixed $expected, ?mixed $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertMatchesRegularExpression(string $pattern, string $string, string $message = '') : void
 

Asserts that a string matches a given regular expression.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNan(?mixed $actual, string $message = '') : void
 

Asserts that a variable is nan.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotContains(?mixed $needle, iterable $haystack, string $message = '') : void
 

Asserts that a haystack does not contain a needle.

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotContainsEquals(?mixed $needle, iterable $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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 \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotCount(int $expectedCount, Countable|Traversable|array $haystack, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
public final static PHPUnit\Framework\Assert::assertNotEmpty(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not empty.

  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
  • psalm-assert !empty $actual
public final static PHPUnit\Framework\Assert::assertNotEquals(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are not equal.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotEqualsCanonicalizing(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are not equal (canonicalizing).

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotEqualsIgnoringCase(?mixed $expected, ?mixed $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotEqualsWithDelta(?mixed $expected, ?mixed $actual, float $delta, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotFalse(?mixed $condition, string $message = '') : void
 

Asserts that a condition is not false.

  • throws \ExpectationFailedException
  • psalm-assert !false $condition
public final static PHPUnit\Framework\Assert::assertNotInstanceOf(string $expected, ?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of a given type.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-template ExpectedType of object
  • psalm-param class-string<ExpectedType> $expected
  • psalm-assert !ExpectedType $actual
public final static PHPUnit\Framework\Assert::assertNotNull(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not null.

  • throws \ExpectationFailedException
  • psalm-assert !null $actual
public final static PHPUnit\Framework\Assert::assertNotSame(?mixed $expected, ?mixed $actual, string $message = '') : void
 

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

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotSameSize(Countable|Traversable|array $expected, Countable|Traversable|array $actual, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
public final static PHPUnit\Framework\Assert::assertNotTrue(?mixed $condition, string $message = '') : void
 

Asserts that a condition is not true.

  • throws \ExpectationFailedException
  • psalm-assert !true $condition
public final static PHPUnit\Framework\Assert::assertNull(?mixed $actual, string $message = '') : void
 

Asserts that a variable is null.

  • throws \ExpectationFailedException
  • psalm-assert null $actual
public final static PHPUnit\Framework\Assert::assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertObjectHasProperty(string $propertyName, object $object, string $message = '') : void
 

Asserts that an object has a specified property.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertObjectNotHasProperty(string $propertyName, object $object, string $message = '') : void
 

Asserts that an object does not have a specified property.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertSame(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables have the same type and value.

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

  • throws \ExpectationFailedException
  • psalm-template ExpectedType
  • psalm-param ExpectedType $expected
  • psalm-assert =ExpectedType $actual
public final static PHPUnit\Framework\Assert::assertSameSize(Countable|Traversable|array $expected, Countable|Traversable|array $actual, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
public final static PHPUnit\Framework\Assert::assertStringContainsString(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringContainsStringIgnoringLineEndings(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringEndsNotWith(string $suffix, string $string, string $message = '') : void
 

Asserts that a string ends not with a given suffix.

  • psalm-param non-empty-string $suffix
  • throws \ExpectationFailedException
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::assertStringEndsWith(string $suffix, string $string, string $message = '') : void
 

Asserts that a string ends with a given suffix.

  • psalm-param non-empty-string $suffix
  • throws \ExpectationFailedException
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertStringEqualsStringIgnoringLineEndings(string $expected, string $actual, string $message = '') : void
 

Asserts that two strings are equal except for line endings.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringMatchesFormat(string $format, string $string, string $message = '') : void
 

Asserts that a string matches a given format string.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
 

Asserts that a string matches a given format file.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringNotContainsString(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertStringNotMatchesFormat(string $format, string $string, string $message = '') : void
 

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

public final static PHPUnit\Framework\Assert::assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
 

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

public final static PHPUnit\Framework\Assert::assertStringStartsNotWith(string $prefix, string $string, string $message = '') : void
 

Asserts that a string starts not with a given prefix.

  • psalm-param non-empty-string $prefix
  • throws \ExpectationFailedException
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::assertStringStartsWith(string $prefix, string $string, string $message = '') : void
 

Asserts that a string starts with a given prefix.

  • psalm-param non-empty-string $prefix
  • throws \ExpectationFailedException
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::assertThat(?mixed $value, PHPUnit\Framework\Constraint\Constraint $constraint, string $message = '') : void
 

Evaluates a PHPUnit\Framework\Constraint matcher object.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertTrue(?mixed $condition, string $message = '') : void
 

Asserts that a condition is true.

  • throws \ExpectationFailedException
  • psalm-assert true $condition
public final static PHPUnit\Framework\Assert::assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
 

Asserts that two XML files are equal.

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
 

Asserts that two XML files are not equal.

  • throws \PHPUnit\Util\Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertXmlStringEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '') : void
 

Asserts that two XML documents are equal.

  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::assertXmlStringEqualsXmlString(string $expectedXml, string $actualXml, string $message = '') : void
 

Asserts that two XML documents are equal.

  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::assertXmlStringNotEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '') : void
 

Asserts that two XML documents are not equal.

  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::assertXmlStringNotEqualsXmlString(string $expectedXml, string $actualXml, string $message = '') : void
 

Asserts that two XML documents are not equal.

  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::callback(callable $callback) : PHPUnit\Framework\Constraint\Callback
 
  • psalm-template CallbackInput of mixed
  • psalm-param callable(CallbackInput $callback): bool $callback
  • psalm-return Callback<CallbackInput>
public final static PHPUnit\Framework\Assert::containsEqual(?mixed $value) : PHPUnit\Framework\Constraint\TraversableContainsEqual
public final static PHPUnit\Framework\Assert::containsIdentical(?mixed $value) : PHPUnit\Framework\Constraint\TraversableContainsIdentical
public final static PHPUnit\Framework\Assert::containsOnly(string $type) : PHPUnit\Framework\Constraint\TraversableContainsOnly
 
  • throws \Exception
public final static PHPUnit\Framework\Assert::containsOnlyInstancesOf(string $className) : PHPUnit\Framework\Constraint\TraversableContainsOnly
 
  • throws \Exception
public final PHPUnit\Framework\TestCase::count() : int
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::countOf(int $count) : PHPUnit\Framework\Constraint\Count
public final PHPUnit\Framework\TestCase::dataName() : string|int
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::dataSetAsString() : string
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::dataSetAsStringWithData() : string
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::dependencyInput() : array
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::directoryExists() : PHPUnit\Framework\Constraint\DirectoryExists
public final PHPUnit\Framework\TestCase::doesNotPerformAssertions() : bool
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::equalTo(?mixed $value) : PHPUnit\Framework\Constraint\IsEqual
public final static PHPUnit\Framework\Assert::equalToCanonicalizing(?mixed $value) : PHPUnit\Framework\Constraint\IsEqualCanonicalizing
public final static PHPUnit\Framework\Assert::equalToIgnoringCase(?mixed $value) : PHPUnit\Framework\Constraint\IsEqualIgnoringCase
public final static PHPUnit\Framework\Assert::equalToWithDelta(?mixed $value, float $delta) : PHPUnit\Framework\Constraint\IsEqualWithDelta
public final PHPUnit\Framework\TestCase::expectsOutput() : bool
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::fail(string $message = '') : never
 

Fails a test with the given message.

  • throws \AssertionFailedError
public final static PHPUnit\Framework\Assert::fileExists() : PHPUnit\Framework\Constraint\FileExists
public final static PHPUnit\Framework\Assert::getCount() : int
 

Return the current assertion count.

public final static PHPUnit\Framework\Assert::greaterThan(?mixed $value) : PHPUnit\Framework\Constraint\GreaterThan
public final static PHPUnit\Framework\Assert::greaterThanOrEqual(?mixed $value) : PHPUnit\Framework\Constraint\LogicalOr
public final PHPUnit\Framework\TestCase::groups() : array
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::hasDependencyInput() : bool
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::hasUnexpectedOutput() : bool
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::identicalTo(?mixed $value) : PHPUnit\Framework\Constraint\IsIdentical
public final static PHPUnit\Framework\Assert::isEmpty() : PHPUnit\Framework\Constraint\IsEmpty
public final static PHPUnit\Framework\Assert::isFalse() : PHPUnit\Framework\Constraint\IsFalse
public final static PHPUnit\Framework\Assert::isFinite() : PHPUnit\Framework\Constraint\IsFinite
public final static PHPUnit\Framework\Assert::isInfinite() : PHPUnit\Framework\Constraint\IsInfinite
public final PHPUnit\Framework\TestCase::isInIsolation() : bool
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::isInstanceOf(string $className) : PHPUnit\Framework\Constraint\IsInstanceOf
 
  • throws \UnknownClassOrInterfaceException
public final static PHPUnit\Framework\Assert::isJson() : PHPUnit\Framework\Constraint\IsJson
public final static PHPUnit\Framework\Assert::isList() : PHPUnit\Framework\Constraint\IsList
public final static PHPUnit\Framework\Assert::isNan() : PHPUnit\Framework\Constraint\IsNan
public final static PHPUnit\Framework\Assert::isNull() : PHPUnit\Framework\Constraint\IsNull
public final static PHPUnit\Framework\Assert::isReadable() : PHPUnit\Framework\Constraint\IsReadable
public final static PHPUnit\Framework\Assert::isTrue() : PHPUnit\Framework\Constraint\IsTrue
public final static PHPUnit\Framework\Assert::isType(string $type) : PHPUnit\Framework\Constraint\IsType
 
  • psalm-param 'array'|'boolean'|'bool'|'double'|'float'|'integer'|'int'|'null'|'numeric'|'object'|'real'|'resource'|'resource (closed)'|'string'|'scalar'|'callable'|'iterable' $type
  • throws \Exception
public final static PHPUnit\Framework\Assert::isWritable() : PHPUnit\Framework\Constraint\IsWritable
public final static PHPUnit\Framework\Assert::lessThan(?mixed $value) : PHPUnit\Framework\Constraint\LessThan
public final static PHPUnit\Framework\Assert::lessThanOrEqual(?mixed $value) : PHPUnit\Framework\Constraint\LogicalOr
public final static PHPUnit\Framework\Assert::logicalAnd(?mixed $constraints) : PHPUnit\Framework\Constraint\LogicalAnd
 
  • throws \Exception
public final static PHPUnit\Framework\Assert::logicalNot(PHPUnit\Framework\Constraint\Constraint $constraint) : PHPUnit\Framework\Constraint\LogicalNot
public final static PHPUnit\Framework\Assert::logicalOr(?mixed $constraints) : PHPUnit\Framework\Constraint\LogicalOr
public final static PHPUnit\Framework\Assert::logicalXor(?mixed $constraints) : PHPUnit\Framework\Constraint\LogicalXor
public final static PHPUnit\Framework\Assert::markTestIncomplete(string $message = '') : never
 

Mark the test as incomplete.

  • throws \IncompleteTestError
public final static PHPUnit\Framework\Assert::markTestSkipped(string $message = '') : never
 

Mark the test as skipped.

  • throws \SkippedWithMessageException
public final static PHPUnit\Framework\Assert::matches(string $string) : PHPUnit\Framework\Constraint\StringMatchesFormatDescription
public final static PHPUnit\Framework\Assert::matchesRegularExpression(string $pattern) : PHPUnit\Framework\Constraint\RegularExpression
public final PHPUnit\Framework\TestCase::name() : string
 
  • psalm-return non-empty-string
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::nameWithDataSet() : string
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::numberOfAssertionsPerformed() : int
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::objectEquals(object $object, string $method = 'equals') : PHPUnit\Framework\Constraint\ObjectEquals
public final PHPUnit\Framework\TestCase::output() : string
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::providedData() : array
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::provides() : array
 
  • psalm-return list<ExecutionOrderDependency>
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::registerMockObject(PHPUnit\Framework\MockObject\MockObject $mockObject) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::requires() : array
 
  • psalm-return list<ExecutionOrderDependency>
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::resetCount() : void
 

Reset the assertion counter.

public final PHPUnit\Framework\TestCase::result() : ?mixed
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::run() : void
 
  • throws \PHPUnit\Runner\Exception
  • throws \PHPUnit\Util\Exception
  • throws \SebastianBergmann\CodeCoverage\InvalidArgumentException
  • throws \SebastianBergmann\Template\InvalidArgumentException
  • throws \CodeCoverageException
  • throws \Exception
  • throws \NoPreviousThrowableException
  • throws \ProcessIsolationException
  • throws \StaticAnalysisCacheNotConfiguredException
  • throws \UnintentionallyCoveredCodeException
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::runBare() : void
 
  • throws \Throwable
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setBackupGlobals(bool $backupGlobals) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setBackupGlobalsExcludeList(array $backupGlobalsExcludeList) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setBackupStaticProperties(bool $backupStaticProperties) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setBackupStaticPropertiesExcludeList(array $backupStaticPropertiesExcludeList) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setData(string|int $dataName, array $data) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setDependencies(array $dependencies) : void
 
  • psalm-param list<ExecutionOrderDependency> $dependencies
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setDependencyInput(array $dependencyInput) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setGroups(array $groups) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setInIsolation(bool $inIsolation) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setPreserveGlobalState(bool $preserveGlobalState) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setResult(?mixed $result) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setRunClassInSeparateProcess(bool $runClassInSeparateProcess) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::setRunTestInSeparateProcess(bool $runTestInSeparateProcess) : void
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public static PHPUnit\Framework\TestCase::setUpBeforeClass() : void
 

This method is called before the first test of this test class is run.

public final PHPUnit\Framework\TestCase::size() : PHPUnit\Framework\TestSize\TestSize
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::sortId() : string
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::status() : PHPUnit\Framework\TestStatus\TestStatus
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final static PHPUnit\Framework\Assert::stringContains(string $string, bool $case = true) : PHPUnit\Framework\Constraint\StringContains
public final static PHPUnit\Framework\Assert::stringEndsWith(string $suffix) : PHPUnit\Framework\Constraint\StringEndsWith
 
  • psalm-param non-empty-string $suffix
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::stringEqualsStringIgnoringLineEndings(string $string) : PHPUnit\Framework\Constraint\StringEqualsStringIgnoringLineEndings
public final static PHPUnit\Framework\Assert::stringStartsWith(string $prefix) : PHPUnit\Framework\Constraint\StringStartsWith
 
  • psalm-param non-empty-string $prefix
  • throws \InvalidArgumentException
public static PHPUnit\Framework\TestCase::tearDownAfterClass() : void
 

This method is called after the last test of this test class is run.

public testGet()
public testGetDoesNotMemoize()
public testHas()
public testThrowsOnCircularReference()
public testThrowsOnUndefinedInternalService()
public PHPUnit\Framework\TestCase::toString() : string
 

Returns a string representation of the test case.

  • throws \Exception
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::usesDataProvider() : bool
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::valueObjectForEvents() : PHPUnit\Event\Code\TestMethod
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
public final PHPUnit\Framework\TestCase::wasPrepared() : bool
 
  • internal This method is not covered by the backward compatibility promise for PHPUnit
Methods
protected final PHPUnit\Framework\TestCase::any() : PHPUnit\Framework\MockObject\Rule\AnyInvokedCount
 

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

protected PHPUnit\Framework\TestCase::assertPostConditions() : void
 

Performs assertions shared by all tests of a test case.

This method is called between test and tearDown().

protected PHPUnit\Framework\TestCase::assertPreConditions() : void
 

Performs assertions shared by all tests of a test case.

This method is called between setUp() and test.

protected final PHPUnit\Framework\TestCase::atLeast(int $requiredInvocations) : PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount
 

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

protected final PHPUnit\Framework\TestCase::atLeastOnce() : PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce
 

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

protected final PHPUnit\Framework\TestCase::atMost(int $allowedInvocations) : PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount
 

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

protected final PHPUnit\Framework\TestCase::createConfiguredMock(string $originalClassName, array $configuration) : PHPUnit\Framework\MockObject\MockObject
 

Creates (and configures) a mock object for the specified interface or class.

  • psalm-template RealInstanceType of object
  • psalm-param class-string<RealInstanceType> $originalClassName
  • psalm-return MockObject&RealInstanceType
  • throws \InvalidArgumentException
  • throws \MockObjectException
  • throws \NoPreviousThrowableException
protected final static PHPUnit\Framework\TestCase::createConfiguredStub(string $originalClassName, array $configuration) : PHPUnit\Framework\MockObject\Stub
 

Creates (and configures) a test stub for the specified interface or class.

  • psalm-template RealInstanceType of object
  • psalm-param class-string<RealInstanceType> $originalClassName
  • psalm-return Stub&RealInstanceType
  • throws \InvalidArgumentException
  • throws \MockObjectException
  • throws \NoPreviousThrowableException
protected final PHPUnit\Framework\TestCase::createMock(string $originalClassName) : PHPUnit\Framework\MockObject\MockObject
 

Creates a mock object for the specified interface or class.

  • psalm-template RealInstanceType of object
  • psalm-param class-string<RealInstanceType> $originalClassName
  • psalm-return MockObject&RealInstanceType
  • throws \InvalidArgumentException
  • throws \MockObjectException
  • throws \NoPreviousThrowableException
protected final PHPUnit\Framework\TestCase::createMockForIntersectionOfInterfaces(array $interfaces) : PHPUnit\Framework\MockObject\MockObject
 
  • psalm-param list<class-string> $interfaces
  • throws \MockObjectException
protected final PHPUnit\Framework\TestCase::createPartialMock(string $originalClassName, array $methods) : PHPUnit\Framework\MockObject\MockObject
 

Creates a partial mock object for the specified interface or class.

  • psalm-param list<non-empty-string> $methods
  • psalm-template RealInstanceType of object
  • psalm-param class-string<RealInstanceType> $originalClassName
  • psalm-return MockObject&RealInstanceType
  • throws \InvalidArgumentException
  • throws \MockObjectException
protected final static PHPUnit\Framework\TestCase::createStub(string $originalClassName) : PHPUnit\Framework\MockObject\Stub
 

Creates a test stub for the specified interface or class.

  • psalm-template RealInstanceType of object
  • psalm-param class-string<RealInstanceType> $originalClassName
  • psalm-return Stub&RealInstanceType
  • throws \InvalidArgumentException
  • throws \MockObjectException
  • throws \NoPreviousThrowableException
protected final static PHPUnit\Framework\TestCase::createStubForIntersectionOfInterfaces(array $interfaces) : PHPUnit\Framework\MockObject\Stub
 
  • psalm-param list<class-string> $interfaces
  • throws \MockObjectException
protected final PHPUnit\Framework\TestCase::createTestProxy(string $originalClassName, array $constructorArguments = []) : PHPUnit\Framework\MockObject\MockObject
 

Creates a test proxy for the specified class.

protected final PHPUnit\Framework\TestCase::exactly(int $count) : PHPUnit\Framework\MockObject\Rule\InvokedCount
 

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

protected final PHPUnit\Framework\TestCase::expectException(string $exception) : void
 
  • psalm-param class-string<Throwable> $exception
protected final PHPUnit\Framework\TestCase::expectExceptionCode(string|int $code) : void
protected final PHPUnit\Framework\TestCase::expectExceptionMessage(string $message) : void
protected final PHPUnit\Framework\TestCase::expectExceptionMessageMatches(string $regularExpression) : void
protected final PHPUnit\Framework\TestCase::expectExceptionObject(Exception $exception) : void
 

Sets up an expectation for an exception to be raised by the code under test.

Information for expected exception class, expected exception message, and expected exception code are retrieved from a given Exception object.

protected final PHPUnit\Framework\TestCase::expectNotToPerformAssertions() : void
protected final PHPUnit\Framework\TestCase::expectOutputRegex(string $expectedRegex) : void
protected final PHPUnit\Framework\TestCase::expectOutputString(string $expectedString) : void
protected final PHPUnit\Framework\TestCase::expectUserDeprecationMessage(string $expectedUserDeprecationMessage) : void
 
  • psalm-param non-empty-string $expectedUserDeprecationMessage
protected final PHPUnit\Framework\TestCase::expectUserDeprecationMessageMatches(string $expectedUserDeprecationMessageRegularExpression) : void
 
  • psalm-param non-empty-string $expectedUserDeprecationMessageRegularExpression
protected final PHPUnit\Framework\TestCase::getActualOutputForAssertion() : string
protected final PHPUnit\Framework\TestCase::getMockBuilder(string $className) : PHPUnit\Framework\MockObject\MockBuilder
 

Returns a builder object to create mock objects using a fluent interface.

  • psalm-template RealInstanceType of object
  • psalm-param class-string<RealInstanceType> $className
  • psalm-return MockBuilder<RealInstanceType>
protected final PHPUnit\Framework\TestCase::getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false) : PHPUnit\Framework\MockObject\MockObject
 

Creates a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default.

To mock concrete methods, use the 7th parameter ($mockedMethods).

protected final PHPUnit\Framework\TestCase::getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false) : PHPUnit\Framework\MockObject\MockObject
 

Creates a mock object for the specified trait with all abstract methods of the trait mocked. Concrete methods to mock can be specified with the $mockedMethods parameter.

protected final PHPUnit\Framework\TestCase::getMockFromWsdl(string $wsdlFile, string $originalClassName = '', string $mockClassName = '', array $methods = [], bool $callOriginalConstructor = true, array $options = []) : PHPUnit\Framework\MockObject\MockObject
 

Creates a mock object based on the given WSDL file.

protected final PHPUnit\Framework\TestCase::getObjectForTrait(string $traitName, array $arguments = [], string $traitClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true) : object
 

Creates an object that uses the specified trait.

protected getServiceLocator(array $factories) : Psr\Container\ContainerInterface
protected final PHPUnit\Framework\TestCase::iniSet(string $varName, string $newValue) : void
 

This method is a wrapper for the ini_set() function that automatically resets the modified php.ini setting to its original value after the test is run.

protected final PHPUnit\Framework\TestCase::never() : PHPUnit\Framework\MockObject\Rule\InvokedCount
 

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

protected final PHPUnit\Framework\TestCase::once() : PHPUnit\Framework\MockObject\Rule\InvokedCount
 

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

protected final PHPUnit\Framework\TestCase::onConsecutiveCalls(?mixed $arguments) : PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls
 
  • deprecated Use <code>$double->willReturn() instead of $double->will($this->onConsecutiveCalls())
  • see https://github.com/sebastianbergmann/phpunit/issues/5423
  • see https://github.com/sebastianbergmann/phpunit/issues/5425
protected PHPUnit\Framework\TestCase::onNotSuccessfulTest(Throwable $t) : never
 

This method is called when a test method did not execute successfully.

  • throws \Throwable
protected final PHPUnit\Framework\TestCase::registerComparator(SebastianBergmann\Comparator\Comparator $comparator) : void
protected final PHPUnit\Framework\TestCase::registerFailureType(string $classOrInterface) : void
 
  • psalm-param class-string $classOrInterface
protected final PHPUnit\Framework\TestCase::returnArgument(int $argumentIndex) : PHPUnit\Framework\MockObject\Stub\ReturnArgument
 
  • deprecated Use <code>$double->willReturnArgument() instead of $double->will($this->returnArgument())
  • see https://github.com/sebastianbergmann/phpunit/issues/5423
protected final PHPUnit\Framework\TestCase::returnCallback(callable $callback) : PHPUnit\Framework\MockObject\Stub\ReturnCallback
 
  • deprecated Use <code>$double->willReturnCallback() instead of $double->will($this->returnCallback())
  • see https://github.com/sebastianbergmann/phpunit/issues/5423
protected final PHPUnit\Framework\TestCase::returnSelf() : PHPUnit\Framework\MockObject\Stub\ReturnSelf
 
  • deprecated Use <code>$double->willReturnSelf() instead of $double->will($this->returnSelf())
  • see https://github.com/sebastianbergmann/phpunit/issues/5423
protected final PHPUnit\Framework\TestCase::returnValue(?mixed $value) : PHPUnit\Framework\MockObject\Stub\ReturnStub
 
  • deprecated Use <code>$double->willReturn() instead of $double->will($this->returnValue())
  • see https://github.com/sebastianbergmann/phpunit/issues/5423
protected final PHPUnit\Framework\TestCase::returnValueMap(array $valueMap) : PHPUnit\Framework\MockObject\Stub\ReturnValueMap
 
  • deprecated Use <code>$double->willReturnMap() instead of $double->will($this->returnValueMap())
  • see https://github.com/sebastianbergmann/phpunit/issues/5423
protected final PHPUnit\Framework\TestCase::runTest() : ?mixed
 
  • throws \AssertionFailedError
  • throws \Exception
  • throws \ExpectationFailedException
  • throws \Throwable
  • internal This method is not covered by the backward compatibility promise for PHPUnit
protected final PHPUnit\Framework\TestCase::setLocale(?mixed $arguments) : void
 

This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.

protected PHPUnit\Framework\TestCase::setUp() : void
 

This method is called before each test.

protected PHPUnit\Framework\TestCase::tearDown() : void
 

This method is called after each test.

protected final PHPUnit\Framework\TestCase::throwException(Throwable $exception) : PHPUnit\Framework\MockObject\Stub\Exception
protected PHPUnit\Framework\TestCase::transformException(Throwable $t) : Throwable
Methods
public final static PHPUnit\Framework\Assert::anything() : PHPUnit\Framework\Constraint\IsAnything
public final static PHPUnit\Framework\Assert::arrayHasKey(string|int $key) : PHPUnit\Framework\Constraint\ArrayHasKey
public final static PHPUnit\Framework\Assert::assertArrayHasKey(string|int $key, ArrayAccess|array $array, string $message = '') : void
 

Asserts that an array has a specified key.

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayIsEqualToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = '') : void
 

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

  • psalm-param non-empty-list<array-key> $keysToBeIgnored
  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayIsEqualToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = '') : void
 

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

  • psalm-param non-empty-list<array-key> $keysToBeConsidered
  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayIsIdenticalToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = '') : void
 

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

  • psalm-param non-empty-list<array-key> $keysToBeIgnored
  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = '') : void
 

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

  • psalm-param non-empty-list<array-key> $keysToBeConsidered
  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertArrayNotHasKey(string|int $key, ArrayAccess|array $array, string $message = '') : void
 

Asserts that an array does not have a specified key.

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertContains(?mixed $needle, iterable $haystack, string $message = '') : void
 

Asserts that a haystack contains a needle.

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertContainsEquals(?mixed $needle, iterable $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = NULL, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertCount(int $expectedCount, Countable|Traversable|array $haystack, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
public final static PHPUnit\Framework\Assert::assertDirectoryDoesNotExist(string $directory, string $message = '') : void
 

Asserts that a directory does not exist.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryExists(string $directory, string $message = '') : void
 

Asserts that a directory exists.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryIsNotReadable(string $directory, string $message = '') : void
 

Asserts that a directory exists and is not readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryIsNotWritable(string $directory, string $message = '') : void
 

Asserts that a directory exists and is not writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryIsReadable(string $directory, string $message = '') : void
 

Asserts that a directory exists and is readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDirectoryIsWritable(string $directory, string $message = '') : void
 

Asserts that a directory exists and is writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertEmpty(?mixed $actual, string $message = '') : void
 

Asserts that a variable is empty.

  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
  • psalm-assert empty $actual
public final static PHPUnit\Framework\Assert::assertEquals(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are equal.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertEqualsCanonicalizing(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are equal (canonicalizing).

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertEqualsIgnoringCase(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are equal (ignoring case).

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertEqualsWithDelta(?mixed $expected, ?mixed $actual, float $delta, string $message = '') : void
 

Asserts that two variables are equal (with delta).

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFalse(?mixed $condition, string $message = '') : void
 

Asserts that a condition is false.

  • throws \ExpectationFailedException
  • psalm-assert false $condition
public final static PHPUnit\Framework\Assert::assertFileDoesNotExist(string $filename, string $message = '') : void
 

Asserts that a file does not exist.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileEquals(string $expected, string $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertFileExists(string $filename, string $message = '') : void
 

Asserts that a file exists.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileIsNotReadable(string $file, string $message = '') : void
 

Asserts that a file exists and is not readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileIsNotWritable(string $file, string $message = '') : void
 

Asserts that a file exists and is not writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileIsReadable(string $file, string $message = '') : void
 

Asserts that a file exists and is readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileIsWritable(string $file, string $message = '') : void
 

Asserts that a file exists and is writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileMatchesFormat(string $format, string $actualFile, string $message = '') : void
 

Asserts that a string matches a given format string.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileMatchesFormatFile(string $formatFile, string $actualFile, string $message = '') : void
 

Asserts that a string matches a given format string.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertFileNotEquals(string $expected, string $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertFinite(?mixed $actual, string $message = '') : void
 

Asserts that a variable is finite.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertGreaterThan(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that a value is greater than another value.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertGreaterThanOrEqual(?mixed $expected, ?mixed $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertInfinite(?mixed $actual, string $message = '') : void
 

Asserts that a variable is infinite.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertInstanceOf(string $expected, ?mixed $actual, string $message = '') : void
 

Asserts that a variable is of a given type.

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \UnknownClassOrInterfaceException
  • psalm-template ExpectedType of object
  • psalm-param class-string<ExpectedType> $expected
  • psalm-assert =ExpectedType $actual
public final static PHPUnit\Framework\Assert::assertIsArray(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type array.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert array $actual
public final static PHPUnit\Framework\Assert::assertIsBool(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type bool.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert bool $actual
public final static PHPUnit\Framework\Assert::assertIsCallable(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type callable.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert callable $actual
public final static PHPUnit\Framework\Assert::assertIsClosedResource(?mixed $actual, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert resource $actual
public final static PHPUnit\Framework\Assert::assertIsFloat(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type float.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert float $actual
public final static PHPUnit\Framework\Assert::assertIsInt(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type int.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert int $actual
public final static PHPUnit\Framework\Assert::assertIsIterable(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type iterable.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert iterable $actual
public final static PHPUnit\Framework\Assert::assertIsList(?mixed $array, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertIsNotArray(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type array.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !array $actual
public final static PHPUnit\Framework\Assert::assertIsNotBool(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type bool.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !bool $actual
public final static PHPUnit\Framework\Assert::assertIsNotCallable(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type callable.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !callable $actual
public final static PHPUnit\Framework\Assert::assertIsNotClosedResource(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type resource.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !resource $actual
public final static PHPUnit\Framework\Assert::assertIsNotFloat(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type float.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !float $actual
public final static PHPUnit\Framework\Assert::assertIsNotInt(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type int.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !int $actual
public final static PHPUnit\Framework\Assert::assertIsNotIterable(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type iterable.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !iterable $actual
public final static PHPUnit\Framework\Assert::assertIsNotNumeric(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type numeric.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !numeric $actual
public final static PHPUnit\Framework\Assert::assertIsNotObject(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type object.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !object $actual
public final static PHPUnit\Framework\Assert::assertIsNotReadable(string $filename, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertIsNotResource(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type resource.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !resource $actual
public final static PHPUnit\Framework\Assert::assertIsNotScalar(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type scalar.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !scalar $actual
public final static PHPUnit\Framework\Assert::assertIsNotString(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of type string.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert !string $actual
public final static PHPUnit\Framework\Assert::assertIsNotWritable(string $filename, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertIsNumeric(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type numeric.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert numeric $actual
public final static PHPUnit\Framework\Assert::assertIsObject(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type object.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert object $actual
public final static PHPUnit\Framework\Assert::assertIsReadable(string $filename, string $message = '') : void
 

Asserts that a file/dir is readable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertIsResource(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type resource.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert resource $actual
public final static PHPUnit\Framework\Assert::assertIsScalar(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type scalar.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert scalar $actual
public final static PHPUnit\Framework\Assert::assertIsString(?mixed $actual, string $message = '') : void
 

Asserts that a variable is of type string.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-assert string $actual
public final static PHPUnit\Framework\Assert::assertIsWritable(string $filename, string $message = '') : void
 

Asserts that a file/dir exists and is writable.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertJson(string $actual, string $message = '') : void
 

Asserts that a string is a valid JSON string.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
 

Asserts that two JSON files are equal.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
 

Asserts that two JSON files are not equal.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertJsonStringNotEqualsJsonString(string $expectedJson, string $actualJson, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertLessThan(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that a value is smaller than another value.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertLessThanOrEqual(?mixed $expected, ?mixed $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertMatchesRegularExpression(string $pattern, string $string, string $message = '') : void
 

Asserts that a string matches a given regular expression.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNan(?mixed $actual, string $message = '') : void
 

Asserts that a variable is nan.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotContains(?mixed $needle, iterable $haystack, string $message = '') : void
 

Asserts that a haystack does not contain a needle.

  • throws \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotContainsEquals(?mixed $needle, iterable $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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 \Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotCount(int $expectedCount, Countable|Traversable|array $haystack, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
public final static PHPUnit\Framework\Assert::assertNotEmpty(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not empty.

  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
  • psalm-assert !empty $actual
public final static PHPUnit\Framework\Assert::assertNotEquals(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are not equal.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotEqualsCanonicalizing(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables are not equal (canonicalizing).

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotEqualsIgnoringCase(?mixed $expected, ?mixed $actual, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotEqualsWithDelta(?mixed $expected, ?mixed $actual, float $delta, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotFalse(?mixed $condition, string $message = '') : void
 

Asserts that a condition is not false.

  • throws \ExpectationFailedException
  • psalm-assert !false $condition
public final static PHPUnit\Framework\Assert::assertNotInstanceOf(string $expected, ?mixed $actual, string $message = '') : void
 

Asserts that a variable is not of a given type.

  • throws \Exception
  • throws \ExpectationFailedException
  • psalm-template ExpectedType of object
  • psalm-param class-string<ExpectedType> $expected
  • psalm-assert !ExpectedType $actual
public final static PHPUnit\Framework\Assert::assertNotNull(?mixed $actual, string $message = '') : void
 

Asserts that a variable is not null.

  • throws \ExpectationFailedException
  • psalm-assert !null $actual
public final static PHPUnit\Framework\Assert::assertNotSame(?mixed $expected, ?mixed $actual, string $message = '') : void
 

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

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertNotSameSize(Countable|Traversable|array $expected, Countable|Traversable|array $actual, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
public final static PHPUnit\Framework\Assert::assertNotTrue(?mixed $condition, string $message = '') : void
 

Asserts that a condition is not true.

  • throws \ExpectationFailedException
  • psalm-assert !true $condition
public final static PHPUnit\Framework\Assert::assertNull(?mixed $actual, string $message = '') : void
 

Asserts that a variable is null.

  • throws \ExpectationFailedException
  • psalm-assert null $actual
public final static PHPUnit\Framework\Assert::assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertObjectHasProperty(string $propertyName, object $object, string $message = '') : void
 

Asserts that an object has a specified property.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertObjectNotHasProperty(string $propertyName, object $object, string $message = '') : void
 

Asserts that an object does not have a specified property.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertSame(?mixed $expected, ?mixed $actual, string $message = '') : void
 

Asserts that two variables have the same type and value.

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

  • throws \ExpectationFailedException
  • psalm-template ExpectedType
  • psalm-param ExpectedType $expected
  • psalm-assert =ExpectedType $actual
public final static PHPUnit\Framework\Assert::assertSameSize(Countable|Traversable|array $expected, Countable|Traversable|array $actual, string $message = '') : void
 

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

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \GeneratorNotSupportedException
public final static PHPUnit\Framework\Assert::assertStringContainsString(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringContainsStringIgnoringLineEndings(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringEndsNotWith(string $suffix, string $string, string $message = '') : void
 

Asserts that a string ends not with a given suffix.

  • psalm-param non-empty-string $suffix
  • throws \ExpectationFailedException
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::assertStringEndsWith(string $suffix, string $string, string $message = '') : void
 

Asserts that a string ends with a given suffix.

  • psalm-param non-empty-string $suffix
  • throws \ExpectationFailedException
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertStringEqualsStringIgnoringLineEndings(string $expected, string $actual, string $message = '') : void
 

Asserts that two strings are equal except for line endings.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringMatchesFormat(string $format, string $string, string $message = '') : void
 

Asserts that a string matches a given format string.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
 

Asserts that a string matches a given format file.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringNotContainsString(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
 
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '') : void
 

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

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::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
public final static PHPUnit\Framework\Assert::assertStringNotMatchesFormat(string $format, string $string, string $message = '') : void
 

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

public final static PHPUnit\Framework\Assert::assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
 

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

public final static PHPUnit\Framework\Assert::assertStringStartsNotWith(string $prefix, string $string, string $message = '') : void
 

Asserts that a string starts not with a given prefix.

  • psalm-param non-empty-string $prefix
  • throws \ExpectationFailedException
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::assertStringStartsWith(string $prefix, string $string, string $message = '') : void
 

Asserts that a string starts with a given prefix.

  • psalm-param non-empty-string $prefix
  • throws \ExpectationFailedException
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::assertThat(?mixed $value, PHPUnit\Framework\Constraint\Constraint $constraint, string $message = '') : void
 

Evaluates a PHPUnit\Framework\Constraint matcher object.

  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertTrue(?mixed $condition, string $message = '') : void
 

Asserts that a condition is true.

  • throws \ExpectationFailedException
  • psalm-assert true $condition
public final static PHPUnit\Framework\Assert::assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
 

Asserts that two XML files are equal.

  • throws \Exception
  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
 

Asserts that two XML files are not equal.

  • throws \PHPUnit\Util\Exception
  • throws \ExpectationFailedException
public final static PHPUnit\Framework\Assert::assertXmlStringEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '') : void
 

Asserts that two XML documents are equal.

  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::assertXmlStringEqualsXmlString(string $expectedXml, string $actualXml, string $message = '') : void
 

Asserts that two XML documents are equal.

  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::assertXmlStringNotEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '') : void
 

Asserts that two XML documents are not equal.

  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::assertXmlStringNotEqualsXmlString(string $expectedXml, string $actualXml, string $message = '') : void
 

Asserts that two XML documents are not equal.

  • throws \ExpectationFailedException
  • throws \XmlException
public final static PHPUnit\Framework\Assert::callback(callable $callback) : PHPUnit\Framework\Constraint\Callback
 
  • psalm-template CallbackInput of mixed
  • psalm-param callable(CallbackInput $callback): bool $callback
  • psalm-return Callback<CallbackInput>
public final static PHPUnit\Framework\Assert::containsEqual(?mixed $value) : PHPUnit\Framework\Constraint\TraversableContainsEqual
public final static PHPUnit\Framework\Assert::containsIdentical(?mixed $value) : PHPUnit\Framework\Constraint\TraversableContainsIdentical
public final static PHPUnit\Framework\Assert::containsOnly(string $type) : PHPUnit\Framework\Constraint\TraversableContainsOnly
 
  • throws \Exception
public final static PHPUnit\Framework\Assert::containsOnlyInstancesOf(string $className) : PHPUnit\Framework\Constraint\TraversableContainsOnly
 
  • throws \Exception
public final static PHPUnit\Framework\Assert::countOf(int $count) : PHPUnit\Framework\Constraint\Count
protected final static PHPUnit\Framework\TestCase::createConfiguredStub(string $originalClassName, array $configuration) : PHPUnit\Framework\MockObject\Stub
 

Creates (and configures) a test stub for the specified interface or class.

  • psalm-template RealInstanceType of object
  • psalm-param class-string<RealInstanceType> $originalClassName
  • psalm-return Stub&RealInstanceType
  • throws \InvalidArgumentException
  • throws \MockObjectException
  • throws \NoPreviousThrowableException
protected final static PHPUnit\Framework\TestCase::createStub(string $originalClassName) : PHPUnit\Framework\MockObject\Stub
 

Creates a test stub for the specified interface or class.

  • psalm-template RealInstanceType of object
  • psalm-param class-string<RealInstanceType> $originalClassName
  • psalm-return Stub&RealInstanceType
  • throws \InvalidArgumentException
  • throws \MockObjectException
  • throws \NoPreviousThrowableException
protected final static PHPUnit\Framework\TestCase::createStubForIntersectionOfInterfaces(array $interfaces) : PHPUnit\Framework\MockObject\Stub
 
  • psalm-param list<class-string> $interfaces
  • throws \MockObjectException
public final static PHPUnit\Framework\Assert::directoryExists() : PHPUnit\Framework\Constraint\DirectoryExists
public final static PHPUnit\Framework\Assert::equalTo(?mixed $value) : PHPUnit\Framework\Constraint\IsEqual
public final static PHPUnit\Framework\Assert::equalToCanonicalizing(?mixed $value) : PHPUnit\Framework\Constraint\IsEqualCanonicalizing
public final static PHPUnit\Framework\Assert::equalToIgnoringCase(?mixed $value) : PHPUnit\Framework\Constraint\IsEqualIgnoringCase
public final static PHPUnit\Framework\Assert::equalToWithDelta(?mixed $value, float $delta) : PHPUnit\Framework\Constraint\IsEqualWithDelta
public final static PHPUnit\Framework\Assert::fail(string $message = '') : never
 

Fails a test with the given message.

  • throws \AssertionFailedError
public final static PHPUnit\Framework\Assert::fileExists() : PHPUnit\Framework\Constraint\FileExists
public final static PHPUnit\Framework\Assert::getCount() : int
 

Return the current assertion count.

public final static PHPUnit\Framework\Assert::greaterThan(?mixed $value) : PHPUnit\Framework\Constraint\GreaterThan
public final static PHPUnit\Framework\Assert::greaterThanOrEqual(?mixed $value) : PHPUnit\Framework\Constraint\LogicalOr
public final static PHPUnit\Framework\Assert::identicalTo(?mixed $value) : PHPUnit\Framework\Constraint\IsIdentical
public final static PHPUnit\Framework\Assert::isEmpty() : PHPUnit\Framework\Constraint\IsEmpty
public final static PHPUnit\Framework\Assert::isFalse() : PHPUnit\Framework\Constraint\IsFalse
public final static PHPUnit\Framework\Assert::isFinite() : PHPUnit\Framework\Constraint\IsFinite
public final static PHPUnit\Framework\Assert::isInfinite() : PHPUnit\Framework\Constraint\IsInfinite
public final static PHPUnit\Framework\Assert::isInstanceOf(string $className) : PHPUnit\Framework\Constraint\IsInstanceOf
 
  • throws \UnknownClassOrInterfaceException
public final static PHPUnit\Framework\Assert::isJson() : PHPUnit\Framework\Constraint\IsJson
public final static PHPUnit\Framework\Assert::isList() : PHPUnit\Framework\Constraint\IsList
public final static PHPUnit\Framework\Assert::isNan() : PHPUnit\Framework\Constraint\IsNan
public final static PHPUnit\Framework\Assert::isNull() : PHPUnit\Framework\Constraint\IsNull
public final static PHPUnit\Framework\Assert::isReadable() : PHPUnit\Framework\Constraint\IsReadable
public final static PHPUnit\Framework\Assert::isTrue() : PHPUnit\Framework\Constraint\IsTrue
public final static PHPUnit\Framework\Assert::isType(string $type) : PHPUnit\Framework\Constraint\IsType
 
  • psalm-param 'array'|'boolean'|'bool'|'double'|'float'|'integer'|'int'|'null'|'numeric'|'object'|'real'|'resource'|'resource (closed)'|'string'|'scalar'|'callable'|'iterable' $type
  • throws \Exception
public final static PHPUnit\Framework\Assert::isWritable() : PHPUnit\Framework\Constraint\IsWritable
public final static PHPUnit\Framework\Assert::lessThan(?mixed $value) : PHPUnit\Framework\Constraint\LessThan
public final static PHPUnit\Framework\Assert::lessThanOrEqual(?mixed $value) : PHPUnit\Framework\Constraint\LogicalOr
public final static PHPUnit\Framework\Assert::logicalAnd(?mixed $constraints) : PHPUnit\Framework\Constraint\LogicalAnd
 
  • throws \Exception
public final static PHPUnit\Framework\Assert::logicalNot(PHPUnit\Framework\Constraint\Constraint $constraint) : PHPUnit\Framework\Constraint\LogicalNot
public final static PHPUnit\Framework\Assert::logicalOr(?mixed $constraints) : PHPUnit\Framework\Constraint\LogicalOr
public final static PHPUnit\Framework\Assert::logicalXor(?mixed $constraints) : PHPUnit\Framework\Constraint\LogicalXor
public final static PHPUnit\Framework\Assert::markTestIncomplete(string $message = '') : never
 

Mark the test as incomplete.

  • throws \IncompleteTestError
public final static PHPUnit\Framework\Assert::markTestSkipped(string $message = '') : never
 

Mark the test as skipped.

  • throws \SkippedWithMessageException
public final static PHPUnit\Framework\Assert::matches(string $string) : PHPUnit\Framework\Constraint\StringMatchesFormatDescription
public final static PHPUnit\Framework\Assert::matchesRegularExpression(string $pattern) : PHPUnit\Framework\Constraint\RegularExpression
public final static PHPUnit\Framework\Assert::objectEquals(object $object, string $method = 'equals') : PHPUnit\Framework\Constraint\ObjectEquals
public final static PHPUnit\Framework\Assert::resetCount() : void
 

Reset the assertion counter.

public static PHPUnit\Framework\TestCase::setUpBeforeClass() : void
 

This method is called before the first test of this test class is run.

public final static PHPUnit\Framework\Assert::stringContains(string $string, bool $case = true) : PHPUnit\Framework\Constraint\StringContains
public final static PHPUnit\Framework\Assert::stringEndsWith(string $suffix) : PHPUnit\Framework\Constraint\StringEndsWith
 
  • psalm-param non-empty-string $suffix
  • throws \InvalidArgumentException
public final static PHPUnit\Framework\Assert::stringEqualsStringIgnoringLineEndings(string $string) : PHPUnit\Framework\Constraint\StringEqualsStringIgnoringLineEndings
public final static PHPUnit\Framework\Assert::stringStartsWith(string $prefix) : PHPUnit\Framework\Constraint\StringStartsWith
 
  • psalm-param non-empty-string $prefix
  • throws \InvalidArgumentException
public static PHPUnit\Framework\TestCase::tearDownAfterClass() : void
 

This method is called after the last test of this test class is run.

© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration