From 83a7a9586da9b409bc4c9bd6d42824d0a6ed0018 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Thu, 26 Sep 2024 14:27:20 +0200 Subject: [PATCH] Assert on string equality instead of regexes --- Tests/Controller/UserValueResolverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Controller/UserValueResolverTest.php b/Tests/Controller/UserValueResolverTest.php index 7a95ca7..6521c33 100644 --- a/Tests/Controller/UserValueResolverTest.php +++ b/Tests/Controller/UserValueResolverTest.php @@ -120,7 +120,7 @@ public function testResolveThrowsAccessDeniedWithWrongUserClass() $metadata = new ArgumentMetadata('foo', InMemoryUser::class, false, false, null, false, [new CurrentUser()]); $this->expectException(AccessDeniedException::class); - $this->expectExceptionMessageMatches(\sprintf('/^The logged-in user is an instance of "%s" but a user of type "Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\InMemoryUser" is expected.$/', $user::class)); + $this->expectExceptionMessage(\sprintf('The logged-in user is an instance of "%s" but a user of type "Symfony\Component\Security\Core\User\InMemoryUser" is expected.', $user::class)); $resolver->resolve(Request::create('/'), $metadata); }