Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Helldar committed Dec 22, 2020
1 parent 92657de commit ba01739
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/ExtendedTests/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,27 @@ public static function assertIsArray($actual, string $message = ''): void
*/
public static function assertIsInt($actual, string $message = ''): void
{
if (method_exists(parent::class, 'assertIsArray')) {
if (method_exists(parent::class, 'assertIsInt')) {
parent::assertIsInt($actual, $message);
} else {
static::assertTrue(is_int($actual), $message);
}
}

/**
* Asserts that a variable is of type string.
*
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert string $actual
*/
public static function assertIsString($actual, string $message = ''): void
{
if (method_exists(parent::class, 'assertIsString')) {
parent::assertIsString($actual, $message);
} else {
static::assertTrue(is_string($actual), $message);
}
}
}

0 comments on commit ba01739

Please sign in to comment.