*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework;
use function func_get_args;
use function function_exists;
use ArrayAccess;
use Countable;
use PHPUnit\Framework\Constraint\ArrayHasKey;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\Constraint\Constraint;
use PHPUnit\Framework\Constraint\Count;
use PHPUnit\Framework\Constraint\DirectoryExists;
use PHPUnit\Framework\Constraint\FileExists;
use PHPUnit\Framework\Constraint\GreaterThan;
use PHPUnit\Framework\Constraint\IsAnything;
use PHPUnit\Framework\Constraint\IsEmpty;
use PHPUnit\Framework\Constraint\IsEqual;
use PHPUnit\Framework\Constraint\IsEqualCanonicalizing;
use PHPUnit\Framework\Constraint\IsEqualIgnoringCase;
use PHPUnit\Framework\Constraint\IsEqualWithDelta;
use PHPUnit\Framework\Constraint\IsFalse;
use PHPUnit\Framework\Constraint\IsFinite;
use PHPUnit\Framework\Constraint\IsIdentical;
use PHPUnit\Framework\Constraint\IsInfinite;
use PHPUnit\Framework\Constraint\IsInstanceOf;
use PHPUnit\Framework\Constraint\IsJson;
use PHPUnit\Framework\Constraint\IsList;
use PHPUnit\Framework\Constraint\IsNan;
use PHPUnit\Framework\Constraint\IsNull;
use PHPUnit\Framework\Constraint\IsReadable;
use PHPUnit\Framework\Constraint\IsTrue;
use PHPUnit\Framework\Constraint\IsType;
use PHPUnit\Framework\Constraint\IsWritable;
use PHPUnit\Framework\Constraint\LessThan;
use PHPUnit\Framework\Constraint\LogicalAnd;
use PHPUnit\Framework\Constraint\LogicalNot;
use PHPUnit\Framework\Constraint\LogicalOr;
use PHPUnit\Framework\Constraint\LogicalXor;
use PHPUnit\Framework\Constraint\ObjectEquals;
use PHPUnit\Framework\Constraint\RegularExpression;
use PHPUnit\Framework\Constraint\StringContains;
use PHPUnit\Framework\Constraint\StringEndsWith;
use PHPUnit\Framework\Constraint\StringEqualsStringIgnoringLineEndings;
use PHPUnit\Framework\Constraint\StringMatchesFormatDescription;
use PHPUnit\Framework\Constraint\StringStartsWith;
use PHPUnit\Framework\Constraint\TraversableContainsEqual;
use PHPUnit\Framework\Constraint\TraversableContainsIdentical;
use PHPUnit\Framework\Constraint\TraversableContainsOnly;
use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount as AnyInvokedCountMatcher;
use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount as InvokedAtLeastCountMatcher;
use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce as InvokedAtLeastOnceMatcher;
use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher;
use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher;
use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub;
use PHPUnit\Framework\MockObject\Stub\Exception as ExceptionStub;
use PHPUnit\Framework\MockObject\Stub\ReturnArgument as ReturnArgumentStub;
use PHPUnit\Framework\MockObject\Stub\ReturnCallback as ReturnCallbackStub;
use PHPUnit\Framework\MockObject\Stub\ReturnSelf as ReturnSelfStub;
use PHPUnit\Framework\MockObject\Stub\ReturnStub;
use PHPUnit\Framework\MockObject\Stub\ReturnValueMap as ReturnValueMapStub;
use PHPUnit\Util\Xml\XmlException;
use Throwable;
if (!function_exists('PHPUnit\Framework\assertArrayHasKey')) {
/**
* Asserts that an array has a specified key.
*
* @throws Exception
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertArrayHasKey
*/
function assertArrayHasKey(mixed $key, array|ArrayAccess $array, string $message = ''): void
{
Assert::assertArrayHasKey(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertArrayNotHasKey')) {
/**
* Asserts that an array does not have a specified key.
*
* @throws Exception
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertArrayNotHasKey
*/
function assertArrayNotHasKey(mixed $key, array|ArrayAccess $array, string $message = ''): void
{
Assert::assertArrayNotHasKey(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertIsList')) {
/**
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertIsList
*/
function assertIsList(mixed $array, string $message = ''): void
{
Assert::assertIsList(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertContains')) {
/**
* Asserts that a haystack contains a needle.
*
* @throws Exception
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertContains
*/
function assertContains(mixed $needle, iterable $haystack, string $message = ''): void
{
Assert::assertContains(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertContainsEquals')) {
/**
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertContainsEquals
*/
function assertContainsEquals(mixed $needle, iterable $haystack, string $message = ''): void
{
Assert::assertContainsEquals(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotContains')) {
/**
* Asserts that a haystack does not contain a needle.
*
* @throws Exception
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotContains
*/
function assertNotContains(mixed $needle, iterable $haystack, string $message = ''): void
{
Assert::assertNotContains(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotContainsEquals')) {
/**
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotContainsEquals
*/
function assertNotContainsEquals(mixed $needle, iterable $haystack, string $message = ''): void
{
Assert::assertNotContainsEquals(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertContainsOnly')) {
/**
* Asserts that a haystack contains only values of a given type.
*
* @throws Exception
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertContainsOnly
*/
function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void
{
Assert::assertContainsOnly(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertContainsOnlyInstancesOf')) {
/**
* Asserts that a haystack contains only instances of a given class name.
*
* @throws Exception
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertContainsOnlyInstancesOf
*/
function assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = ''): void
{
Assert::assertContainsOnlyInstancesOf(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotContainsOnly')) {
/**
* Asserts that a haystack does not contain only values of a given type.
*
* @throws Exception
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotContainsOnly
*/
function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void
{
Assert::assertNotContainsOnly(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertCount')) {
/**
* Asserts the number of elements of an array, Countable or Traversable.
*
* @throws Exception
* @throws ExpectationFailedException
* @throws GeneratorNotSupportedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertCount
*/
function assertCount(int $expectedCount, Countable|iterable $haystack, string $message = ''): void
{
Assert::assertCount(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotCount')) {
/**
* Asserts the number of elements of an array, Countable or Traversable.
*
* @throws Exception
* @throws ExpectationFailedException
* @throws GeneratorNotSupportedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotCount
*/
function assertNotCount(int $expectedCount, Countable|iterable $haystack, string $message = ''): void
{
Assert::assertNotCount(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertEquals')) {
/**
* Asserts that two variables are equal.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertEquals
*/
function assertEquals(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertEquals(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertEqualsCanonicalizing')) {
/**
* Asserts that two variables are equal (canonicalizing).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertEqualsCanonicalizing
*/
function assertEqualsCanonicalizing(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertEqualsCanonicalizing(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertEqualsIgnoringCase')) {
/**
* Asserts that two variables are equal (ignoring case).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertEqualsIgnoringCase
*/
function assertEqualsIgnoringCase(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertEqualsIgnoringCase(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertEqualsWithDelta')) {
/**
* Asserts that two variables are equal (with delta).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertEqualsWithDelta
*/
function assertEqualsWithDelta(mixed $expected, mixed $actual, float $delta, string $message = ''): void
{
Assert::assertEqualsWithDelta(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotEquals')) {
/**
* Asserts that two variables are not equal.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotEquals
*/
function assertNotEquals(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertNotEquals(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotEqualsCanonicalizing')) {
/**
* Asserts that two variables are not equal (canonicalizing).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotEqualsCanonicalizing
*/
function assertNotEqualsCanonicalizing(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertNotEqualsCanonicalizing(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotEqualsIgnoringCase')) {
/**
* Asserts that two variables are not equal (ignoring case).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotEqualsIgnoringCase
*/
function assertNotEqualsIgnoringCase(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertNotEqualsIgnoringCase(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotEqualsWithDelta')) {
/**
* Asserts that two variables are not equal (with delta).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotEqualsWithDelta
*/
function assertNotEqualsWithDelta(mixed $expected, mixed $actual, float $delta, string $message = ''): void
{
Assert::assertNotEqualsWithDelta(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertObjectEquals')) {
/**
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertObjectEquals
*/
function assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = ''): void
{
Assert::assertObjectEquals(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertEmpty')) {
/**
* Asserts that a variable is empty.
*
* @throws ExpectationFailedException
* @throws GeneratorNotSupportedException
*
* @psalm-assert empty $actual
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertEmpty
*/
function assertEmpty(mixed $actual, string $message = ''): void
{
Assert::assertEmpty(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotEmpty')) {
/**
* Asserts that a variable is not empty.
*
* @throws ExpectationFailedException
* @throws GeneratorNotSupportedException
*
* @psalm-assert !empty $actual
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotEmpty
*/
function assertNotEmpty(mixed $actual, string $message = ''): void
{
Assert::assertNotEmpty(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertGreaterThan')) {
/**
* Asserts that a value is greater than another value.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertGreaterThan
*/
function assertGreaterThan(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertGreaterThan(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertGreaterThanOrEqual')) {
/**
* Asserts that a value is greater than or equal to another value.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertGreaterThanOrEqual
*/
function assertGreaterThanOrEqual(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertGreaterThanOrEqual(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertLessThan')) {
/**
* Asserts that a value is smaller than another value.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertLessThan
*/
function assertLessThan(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertLessThan(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertLessThanOrEqual')) {
/**
* Asserts that a value is smaller than or equal to another value.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertLessThanOrEqual
*/
function assertLessThanOrEqual(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertLessThanOrEqual(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileEquals')) {
/**
* Asserts that the contents of one file is equal to the contents of another
* file.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileEquals
*/
function assertFileEquals(string $expected, string $actual, string $message = ''): void
{
Assert::assertFileEquals(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileEqualsCanonicalizing')) {
/**
* Asserts that the contents of one file is equal to the contents of another
* file (canonicalizing).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileEqualsCanonicalizing
*/
function assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void
{
Assert::assertFileEqualsCanonicalizing(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileEqualsIgnoringCase')) {
/**
* Asserts that the contents of one file is equal to the contents of another
* file (ignoring case).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileEqualsIgnoringCase
*/
function assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void
{
Assert::assertFileEqualsIgnoringCase(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileNotEquals')) {
/**
* Asserts that the contents of one file is not equal to the contents of
* another file.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileNotEquals
*/
function assertFileNotEquals(string $expected, string $actual, string $message = ''): void
{
Assert::assertFileNotEquals(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileNotEqualsCanonicalizing')) {
/**
* Asserts that the contents of one file is not equal to the contents of another
* file (canonicalizing).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileNotEqualsCanonicalizing
*/
function assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void
{
Assert::assertFileNotEqualsCanonicalizing(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileNotEqualsIgnoringCase')) {
/**
* Asserts that the contents of one file is not equal to the contents of another
* file (ignoring case).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileNotEqualsIgnoringCase
*/
function assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void
{
Assert::assertFileNotEqualsIgnoringCase(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertStringEqualsFile')) {
/**
* Asserts that the contents of a string is equal
* to the contents of a file.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertStringEqualsFile
*/
function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = ''): void
{
Assert::assertStringEqualsFile(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertStringEqualsFileCanonicalizing')) {
/**
* Asserts that the contents of a string is equal
* to the contents of a file (canonicalizing).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertStringEqualsFileCanonicalizing
*/
function assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void
{
Assert::assertStringEqualsFileCanonicalizing(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertStringEqualsFileIgnoringCase')) {
/**
* Asserts that the contents of a string is equal
* to the contents of a file (ignoring case).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertStringEqualsFileIgnoringCase
*/
function assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void
{
Assert::assertStringEqualsFileIgnoringCase(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertStringNotEqualsFile')) {
/**
* Asserts that the contents of a string is not equal
* to the contents of a file.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertStringNotEqualsFile
*/
function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = ''): void
{
Assert::assertStringNotEqualsFile(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertStringNotEqualsFileCanonicalizing')) {
/**
* Asserts that the contents of a string is not equal
* to the contents of a file (canonicalizing).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertStringNotEqualsFileCanonicalizing
*/
function assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void
{
Assert::assertStringNotEqualsFileCanonicalizing(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertStringNotEqualsFileIgnoringCase')) {
/**
* Asserts that the contents of a string is not equal
* to the contents of a file (ignoring case).
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertStringNotEqualsFileIgnoringCase
*/
function assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void
{
Assert::assertStringNotEqualsFileIgnoringCase(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertIsReadable')) {
/**
* Asserts that a file/dir is readable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertIsReadable
*/
function assertIsReadable(string $filename, string $message = ''): void
{
Assert::assertIsReadable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertIsNotReadable')) {
/**
* Asserts that a file/dir exists and is not readable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertIsNotReadable
*/
function assertIsNotReadable(string $filename, string $message = ''): void
{
Assert::assertIsNotReadable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertIsWritable')) {
/**
* Asserts that a file/dir exists and is writable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertIsWritable
*/
function assertIsWritable(string $filename, string $message = ''): void
{
Assert::assertIsWritable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertIsNotWritable')) {
/**
* Asserts that a file/dir exists and is not writable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertIsNotWritable
*/
function assertIsNotWritable(string $filename, string $message = ''): void
{
Assert::assertIsNotWritable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertDirectoryExists')) {
/**
* Asserts that a directory exists.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertDirectoryExists
*/
function assertDirectoryExists(string $directory, string $message = ''): void
{
Assert::assertDirectoryExists(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertDirectoryDoesNotExist')) {
/**
* Asserts that a directory does not exist.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertDirectoryDoesNotExist
*/
function assertDirectoryDoesNotExist(string $directory, string $message = ''): void
{
Assert::assertDirectoryDoesNotExist(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertDirectoryIsReadable')) {
/**
* Asserts that a directory exists and is readable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertDirectoryIsReadable
*/
function assertDirectoryIsReadable(string $directory, string $message = ''): void
{
Assert::assertDirectoryIsReadable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertDirectoryIsNotReadable')) {
/**
* Asserts that a directory exists and is not readable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertDirectoryIsNotReadable
*/
function assertDirectoryIsNotReadable(string $directory, string $message = ''): void
{
Assert::assertDirectoryIsNotReadable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertDirectoryIsWritable')) {
/**
* Asserts that a directory exists and is writable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertDirectoryIsWritable
*/
function assertDirectoryIsWritable(string $directory, string $message = ''): void
{
Assert::assertDirectoryIsWritable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertDirectoryIsNotWritable')) {
/**
* Asserts that a directory exists and is not writable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertDirectoryIsNotWritable
*/
function assertDirectoryIsNotWritable(string $directory, string $message = ''): void
{
Assert::assertDirectoryIsNotWritable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileExists')) {
/**
* Asserts that a file exists.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileExists
*/
function assertFileExists(string $filename, string $message = ''): void
{
Assert::assertFileExists(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileDoesNotExist')) {
/**
* Asserts that a file does not exist.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileDoesNotExist
*/
function assertFileDoesNotExist(string $filename, string $message = ''): void
{
Assert::assertFileDoesNotExist(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileIsReadable')) {
/**
* Asserts that a file exists and is readable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileIsReadable
*/
function assertFileIsReadable(string $file, string $message = ''): void
{
Assert::assertFileIsReadable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileIsNotReadable')) {
/**
* Asserts that a file exists and is not readable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileIsNotReadable
*/
function assertFileIsNotReadable(string $file, string $message = ''): void
{
Assert::assertFileIsNotReadable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileIsWritable')) {
/**
* Asserts that a file exists and is writable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileIsWritable
*/
function assertFileIsWritable(string $file, string $message = ''): void
{
Assert::assertFileIsWritable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFileIsNotWritable')) {
/**
* Asserts that a file exists and is not writable.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFileIsNotWritable
*/
function assertFileIsNotWritable(string $file, string $message = ''): void
{
Assert::assertFileIsNotWritable(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertTrue')) {
/**
* Asserts that a condition is true.
*
* @throws ExpectationFailedException
*
* @psalm-assert true $condition
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertTrue
*/
function assertTrue(mixed $condition, string $message = ''): void
{
Assert::assertTrue(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotTrue')) {
/**
* Asserts that a condition is not true.
*
* @throws ExpectationFailedException
*
* @psalm-assert !true $condition
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotTrue
*/
function assertNotTrue(mixed $condition, string $message = ''): void
{
Assert::assertNotTrue(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFalse')) {
/**
* Asserts that a condition is false.
*
* @throws ExpectationFailedException
*
* @psalm-assert false $condition
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFalse
*/
function assertFalse(mixed $condition, string $message = ''): void
{
Assert::assertFalse(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotFalse')) {
/**
* Asserts that a condition is not false.
*
* @throws ExpectationFailedException
*
* @psalm-assert !false $condition
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotFalse
*/
function assertNotFalse(mixed $condition, string $message = ''): void
{
Assert::assertNotFalse(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNull')) {
/**
* Asserts that a variable is null.
*
* @throws ExpectationFailedException
*
* @psalm-assert null $actual
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNull
*/
function assertNull(mixed $actual, string $message = ''): void
{
Assert::assertNull(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotNull')) {
/**
* Asserts that a variable is not null.
*
* @throws ExpectationFailedException
*
* @psalm-assert !null $actual
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotNull
*/
function assertNotNull(mixed $actual, string $message = ''): void
{
Assert::assertNotNull(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertFinite')) {
/**
* Asserts that a variable is finite.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertFinite
*/
function assertFinite(mixed $actual, string $message = ''): void
{
Assert::assertFinite(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertInfinite')) {
/**
* Asserts that a variable is infinite.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertInfinite
*/
function assertInfinite(mixed $actual, string $message = ''): void
{
Assert::assertInfinite(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNan')) {
/**
* Asserts that a variable is nan.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNan
*/
function assertNan(mixed $actual, string $message = ''): void
{
Assert::assertNan(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertObjectHasProperty')) {
/**
* Asserts that an object has a specified property.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertObjectHasProperty
*/
function assertObjectHasProperty(string $propertyName, object $object, string $message = ''): void
{
Assert::assertObjectHasProperty(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertObjectNotHasProperty')) {
/**
* Asserts that an object does not have a specified property.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertObjectNotHasProperty
*/
function assertObjectNotHasProperty(string $propertyName, object $object, string $message = ''): void
{
Assert::assertObjectNotHasProperty(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertSame')) {
/**
* Asserts that two variables have the same type and value.
* Used on objects, it asserts that two variables reference
* the same object.
*
* @psalm-template ExpectedType
*
* @psalm-param ExpectedType $expected
*
* @throws ExpectationFailedException
*
* @psalm-assert =ExpectedType $actual
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertSame
*/
function assertSame(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertSame(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertNotSame')) {
/**
* Asserts that two variables do not have the same type and value.
* Used on objects, it asserts that two variables do not reference
* the same object.
*
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertNotSame
*/
function assertNotSame(mixed $expected, mixed $actual, string $message = ''): void
{
Assert::assertNotSame(...func_get_args());
}
}
if (!function_exists('PHPUnit\Framework\assertInstanceOf')) {
/**
* Asserts that a variable is of a given type.
*
* @psalm-template ExpectedType of object
*
* @psalm-param class-string