psalm-plugin-phpunit/stubs/Assert.php

117 lines
2.8 KiB
PHP
Raw Normal View History

2018-11-14 15:23:26 +01:00
<?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.
*
2019-01-08 20:09:49 +01:00
* @param mixed $condition
2018-11-14 15:23:26 +01:00
* @param string $message
*
* @throws AssertionFailedError
2018-11-14 19:08:56 +01:00
* @psalm-assert true $condition
2018-11-14 15:23:26 +01:00
*/
public static function assertTrue($condition, $message = '') {}
/**
* Asserts that a condition is not true.
*
2019-01-08 20:09:49 +01:00
* @param mixed $condition
2018-11-14 15:23:26 +01:00
* @param string $message
*
* @throws AssertionFailedError
2018-11-14 19:08:56 +01:00
* @psalm-assert !true $condition
2018-11-14 15:23:26 +01:00
*/
public static function assertNotTrue($condition, $message = '') {}
/**
* Asserts that a condition is false.
*
2019-01-08 20:09:49 +01:00
* @param mixed $condition
2018-11-14 15:23:26 +01:00
* @param string $message
*
* @throws AssertionFailedError
2018-11-14 19:08:56 +01:00
* @psalm-assert false $condition
2018-11-14 15:23:26 +01:00
*/
public static function assertFalse($condition, $message = '') {}
/**
* Asserts that a condition is not false.
*
2019-01-08 20:09:49 +01:00
* @param mixed $condition
2018-11-14 15:23:26 +01:00
* @param string $message
*
* @throws AssertionFailedError
2018-11-14 19:08:56 +01:00
* @psalm-assert !false $condition
2018-11-14 15:23:26 +01:00
*/
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 = '') {}
2018-11-16 16:15:09 +01:00
/**
* Asserts that two variables are the same.
*
* @template T
* @param T $expected
* @param mixed $actual
2018-11-16 17:11:43 +01:00
* @param string $message
2018-11-16 16:15:09 +01:00
* @psalm-assert =T $actual
*/
2018-11-16 17:11:43 +01:00
function assertSame($expected, $actual, $message = '') : void {}
2018-11-16 16:15:09 +01:00
2018-11-16 17:05:51 +01:00
/**
* Asserts that two variables are not the same.
*
* @template T
* @param T $expected
* @param mixed $actual
2018-11-16 17:11:43 +01:00
* @param string $message
2018-11-16 17:05:51 +01:00
* @psalm-assert !=T $actual
*/
2018-11-16 17:11:43 +01:00
function assertNotSame($expected, $actual, $message = '') : void {}
2018-11-14 15:23:26 +01:00
}