feat: allow string type in gt/lt expectations

This commit is contained in:
Pauls Nartišs
2024-01-05 16:06:54 +02:00
parent dc1e4f040d
commit b1c59ec2e6
6 changed files with 28 additions and 4 deletions

View File

@ -18,6 +18,11 @@ test('passes with DateTime and DateTimeImmutable', function () {
expect($now)->not->toBeLessThanOrEqual($past);
});
test('passes with strings', function () {
expect('a')->toBeLessThanOrEqual('b');
expect('a')->toBeLessThanOrEqual('a');
});
test('failures', function () {
expect(4)->toBeLessThanOrEqual(3.9);
})->throws(ExpectationFailedException::class);