1
0
Fork 0
mirror of https://github.com/archtechx/enums.git synced 2025-12-12 15:54:04 +00:00

add comment to test

This commit is contained in:
Samuel Štancl 2024-01-12 22:00:38 +01:00
parent 84d56bf843
commit f52feccd85

View file

@ -4,9 +4,12 @@ it('does not override the default BackedEnum from method')
->expect(Status::from(0)) ->expect(Status::from(0))
->toBe(Status::PENDING); ->toBe(Status::PENDING);
// Shortened exception message due to inconsistency between PHP 8.1 and 8.2+
// 8.1: 2 is not a valid backing value for enum "Status"
// 8.2+: 2 is not a valid backing value for enum Status
it('does not override the default BackedEnum from method with errors', function () { it('does not override the default BackedEnum from method with errors', function () {
Status::from(2); Status::from(2);
})->throws(ValueError::class, '2 is not a valid backing value for enum Status'); })->throws(ValueError::class, '2 is not a valid backing value for enum');
it('does not override the default BackedEnum tryFrom method') it('does not override the default BackedEnum tryFrom method')
->expect(Status::tryFrom(1)) ->expect(Status::tryFrom(1))