Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c00a765

Browse files
committed
Fix ParameterBagTest message with PHP 8.2
1 parent f4a9a5d commit c00a765

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ public function testGetEnumThrowsExceptionWithNotBackingValue()
242242
$bag = new ParameterBag(['invalid-value' => 2]);
243243

244244
$this->expectException(\UnexpectedValueException::class);
245-
$this->expectExceptionMessage('Parameter "invalid-value" cannot be converted to enum: 2 is not a valid backing value for enum "Symfony\Component\HttpFoundation\Tests\Foo".');
245+
if (\PHP_VERSION_ID >= 80200) {
246+
$this->expectExceptionMessage('Parameter "invalid-value" cannot be converted to enum: 2 is not a valid backing value for enum Symfony\Component\HttpFoundation\Tests\Foo.');
247+
} else {
248+
$this->expectExceptionMessage('Parameter "invalid-value" cannot be converted to enum: 2 is not a valid backing value for enum "Symfony\Component\HttpFoundation\Tests\Foo".');
249+
}
246250

247251
$this->assertNull($bag->getEnum('invalid-value', Foo::class));
248252
}

0 commit comments

Comments
 (0)