mirror of
https://github.com/danog/psalm-plugin-phpunit.git
synced 2024-12-02 17:38:12 +01:00
95 lines
2.3 KiB
PHP
95 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace PHPUnit\Framework;
|
|
|
|
abstract class Assert
|
|
{
|
|
/**
|
|
* Asserts that a variable is of a given type.
|
|
*
|
|
* @param class-string $expected
|
|
* @param mixed $actual
|
|
* @param string $message
|
|
*
|
|
* @template T
|
|
* @template-typeof T $expected
|
|
* @psalm-assert T $actual
|
|
*/
|
|
public static function assertInstanceOf($expected, $actual, $message = '') {}
|
|
|
|
/**
|
|
* Asserts that a variable is of a given type.
|
|
*
|
|
* @param class-string $expected
|
|
* @param mixed $actual
|
|
* @param string $message
|
|
*
|
|
* @template T
|
|
* @template-typeof T $expected
|
|
* @psalm-assert !T $actual
|
|
*/
|
|
public static function assertNotInstanceOf($expected, $actual, $message = '') {}
|
|
|
|
/**
|
|
* Asserts that a condition is true.
|
|
*
|
|
* @param bool $condition
|
|
* @param string $message
|
|
*
|
|
* @throws AssertionFailedError
|
|
* @psalm-assert true $actual
|
|
*/
|
|
public static function assertTrue($condition, $message = '') {}
|
|
|
|
/**
|
|
* Asserts that a condition is not true.
|
|
*
|
|
* @param bool $condition
|
|
* @param string $message
|
|
*
|
|
* @throws AssertionFailedError
|
|
* @psalm-assert !true $actual
|
|
*/
|
|
public static function assertNotTrue($condition, $message = '') {}
|
|
|
|
/**
|
|
* Asserts that a condition is false.
|
|
*
|
|
* @param bool $condition
|
|
* @param string $message
|
|
*
|
|
* @throws AssertionFailedError
|
|
* @psalm-assert false $actual
|
|
*/
|
|
public static function assertFalse($condition, $message = '') {}
|
|
|
|
/**
|
|
* Asserts that a condition is not false.
|
|
*
|
|
* @param bool $condition
|
|
* @param string $message
|
|
*
|
|
* @throws AssertionFailedError
|
|
* @psalm-assert !false $actual
|
|
*/
|
|
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 = '') {}
|
|
}
|