2020-08-05 02:00:24 +02:00
|
|
|
<?php
|
2019-02-10 07:19:06 +01:00
|
|
|
namespace PHPUnit\Framework;
|
|
|
|
|
|
|
|
abstract class Assert
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert array $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsArray($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert bool $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsBool($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert float $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsFloat($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert int $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsInt($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert numeric $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNumeric($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert object $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsObject($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert resource $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsResource($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert string $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsString($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert scalar $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsScalar($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert callable $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsCallable($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert iterable $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsIterable($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !array $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotArray($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !bool $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotBool($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !float $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotFloat($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !int $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotInt($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !numeric $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotNumeric($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !object $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotObject($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !resource $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotResource($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !string $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotString($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !scalar $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotScalar($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !callable $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotCallable($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $actual
|
|
|
|
* @psalm-assert !iterable $actual
|
2019-02-13 22:03:21 +01:00
|
|
|
* @return void
|
2019-02-10 07:19:06 +01:00
|
|
|
*/
|
2019-02-13 22:03:21 +01:00
|
|
|
public static function assertIsNotIterable($actual, string $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
|
2020-04-05 20:33:48 +02:00
|
|
|
/**
|
|
|
|
* Asserts that a variable is of a given type.
|
2020-09-28 19:25:39 +02:00
|
|
|
* @template T
|
2020-04-05 20:33:48 +02:00
|
|
|
*
|
2020-09-28 19:25:39 +02:00
|
|
|
* @param class-string<T> $expected
|
2020-04-05 20:33:48 +02:00
|
|
|
* @param mixed $actual
|
|
|
|
* @param string $message
|
|
|
|
*
|
|
|
|
* @psalm-assert T $actual
|
|
|
|
*/
|
|
|
|
public static function assertInstanceOf($expected, $actual, $message = '') {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asserts that a variable is of a given type.
|
2020-09-28 19:25:39 +02:00
|
|
|
* @template T
|
2020-04-05 20:33:48 +02:00
|
|
|
*
|
2020-09-28 19:25:39 +02:00
|
|
|
* @param class-string<T> $expected
|
2020-04-05 20:33:48 +02:00
|
|
|
* @param mixed $actual
|
|
|
|
* @param string $message
|
|
|
|
*
|
|
|
|
* @psalm-assert !T $actual
|
|
|
|
*/
|
|
|
|
public static function assertNotInstanceOf($expected, $actual, $message = '') {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asserts that a condition is true.
|
|
|
|
*
|
|
|
|
* @param mixed $condition
|
|
|
|
* @param string $message
|
|
|
|
*
|
|
|
|
* @throws AssertionFailedError
|
|
|
|
* @psalm-assert true $condition
|
|
|
|
*/
|
|
|
|
public static function assertTrue($condition, $message = '') {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asserts that a condition is not true.
|
|
|
|
*
|
|
|
|
* @param mixed $condition
|
|
|
|
* @param string $message
|
|
|
|
*
|
|
|
|
* @throws AssertionFailedError
|
|
|
|
* @psalm-assert !true $condition
|
|
|
|
*/
|
|
|
|
public static function assertNotTrue($condition, $message = '') {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asserts that a condition is false.
|
|
|
|
*
|
|
|
|
* @param mixed $condition
|
|
|
|
* @param string $message
|
|
|
|
*
|
|
|
|
* @throws AssertionFailedError
|
|
|
|
* @psalm-assert false $condition
|
|
|
|
*/
|
|
|
|
public static function assertFalse($condition, $message = '') {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asserts that a condition is not false.
|
|
|
|
*
|
|
|
|
* @param mixed $condition
|
|
|
|
* @param string $message
|
|
|
|
*
|
|
|
|
* @throws AssertionFailedError
|
|
|
|
* @psalm-assert !false $condition
|
|
|
|
*/
|
|
|
|
public static function assertNotFalse($condition, $message = '') {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asserts that a variable is null.
|
|
|
|
*
|
|
|
|
* @param mixed $actual
|
|
|
|
* @param string $message
|
|
|
|
* @psalm-assert null $actual
|
|
|
|
*/
|
|
|
|
public static function assertNull($actual, $message = '') {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asserts that a variable is not null.
|
|
|
|
*
|
|
|
|
* @param mixed $actual
|
|
|
|
* @param string $message
|
|
|
|
* @psalm-assert !null $actual
|
|
|
|
*/
|
|
|
|
public static function assertNotNull($actual, $message = '') {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asserts that two variables are the same.
|
|
|
|
*
|
|
|
|
* @template T
|
|
|
|
* @param T $expected
|
|
|
|
* @param mixed $actual
|
|
|
|
* @param string $message
|
|
|
|
* @psalm-assert =T $actual
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public static function assertSame($expected, $actual, $message = '') {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asserts that two variables are not the same.
|
|
|
|
*
|
|
|
|
* @template T
|
|
|
|
* @param T $expected
|
|
|
|
* @param mixed $actual
|
|
|
|
* @param string $message
|
|
|
|
* @psalm-assert !=T $actual
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public static function assertNotSame($expected, $actual, $message = '') {}
|
2019-02-10 07:19:06 +01:00
|
|
|
}
|