Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #36 from elbgoods/add_nullable_boolean_function
Browse files Browse the repository at this point in the history
add nullable boolean assertion
  • Loading branch information
Gummibeer authored Sep 14, 2020
2 parents fafceba + e672f9e commit ef34b8f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/PHPUnit/Assertions/NullableTypeAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ public static function assertIsNullableArray($actual, ?string $message = null):
);
}

/**
* @param bool|mixed|null $actual
* @param string|null $message
*/
public static function assertIsNullableBool($actual, ?string $message = null): void
{
static::assertIsNullableType(
is_null($actual) || is_bool($actual),
'boolean',
$actual,
$message
);
}

/**
* @param bool $condition
* @param string $type
Expand Down

0 comments on commit ef34b8f

Please sign in to comment.