From f52feccd8500ec9200b02e37a76cdbadbf6cf627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 12 Jan 2024 22:00:38 +0100 Subject: [PATCH] add comment to test --- tests/Pest/FromTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/Pest/FromTest.php b/tests/Pest/FromTest.php index c92fb59..af9605a 100644 --- a/tests/Pest/FromTest.php +++ b/tests/Pest/FromTest.php @@ -4,9 +4,12 @@ it('does not override the default BackedEnum from method') ->expect(Status::from(0)) ->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 () { 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') ->expect(Status::tryFrom(1))