Including tests for Date and DateTimeImmutable

This commit is contained in:
Dan Ang
2023-03-21 14:37:31 +01:00
parent ecbaff503e
commit a8bd353ba6
6 changed files with 46 additions and 2 deletions

View File

@ -7,6 +7,15 @@ test('passes', function () {
expect(4)->toBeLessThan(5);
});
test('passes with DateTime and DateTimeImmutable', function () {
$now = new DateTime();
$past = (new DateTimeImmutable())->modify('-1 day');
expect($past)->toBeLessThan($now);
expect($now)->not->toBeLessThan($now);
});
test('failures', function () {
expect(4)->toBeLessThan(4);
})->throws(ExpectationFailedException::class);