Skip to content

Commit 7c79fae

Browse files
committed
Fix typo in error message
1 parent 8af2666 commit 7c79fae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Controller/UserValueResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable
6161
} elseif (null === $argument->getType() || $user instanceof ($argument->getType())) {
6262
yield $user;
6363
} else {
64-
throw new AccessDeniedException(sprintf('The logged-in user is an instance of "%s" and an user of type "%s" is expected.', $user::class, $argument->getType()));
64+
throw new AccessDeniedException(sprintf('The logged-in user is an instance of "%s" but a user of type "%s" is expected.', $user::class, $argument->getType()));
6565
}
6666
}
6767
}

Tests/Controller/UserValueResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function testResolveThrowsAccessDeniedWithWrongUserClass()
128128

129129
$this->assertTrue($resolver->supports(Request::create('/'), $metadata));
130130
$this->expectException(AccessDeniedException::class);
131-
$this->expectExceptionMessageMatches('/^The logged-in user is an instance of "Mock_UserInterface[^"]+" and an user of type "Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\InMemoryUser" is expected.$/');
131+
$this->expectExceptionMessageMatches('/^The logged-in user is an instance of "Mock_UserInterface[^"]+" but a user of type "Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\InMemoryUser" is expected.$/');
132132
iterator_to_array($resolver->resolve(Request::create('/'), $metadata));
133133
}
134134

0 commit comments

Comments
 (0)