From 416b2714cc21baebe0f2c590356068c72fe39e6b Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Tue, 22 Dec 2020 13:03:11 +0300 Subject: [PATCH] Updated tests --- tests/ExtendedTests/Assert.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/ExtendedTests/Assert.php b/tests/ExtendedTests/Assert.php index 7b7407a..1000e6d 100644 --- a/tests/ExtendedTests/Assert.php +++ b/tests/ExtendedTests/Assert.php @@ -57,4 +57,21 @@ public static function assertIsString($actual, string $message = ''): void static::assertTrue(is_string($actual), $message); } } + + /** + * Asserts that a variable is of type bool. + * + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * + * @psalm-assert bool $actual + */ + public static function assertIsBool($actual, string $message = ''): void + { + if (method_exists(parent::class, 'assertIsBool')) { + parent::assertIsBool($actual, $message); + } else { + static::assertTrue(is_bool($actual), $message); + } + } }