Skip to content

Commit

Permalink
Assert on string equality instead of regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-daubois committed Sep 26, 2024
1 parent 3e43aa9 commit 83a7a95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Tests/Controller/UserValueResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 83a7a95

Please sign in to comment.