mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Including tests for Date and DateTimeImmutable
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user