Skip to content

Commit a8c67a8

Browse files
fix merge
1 parent 79e4c9b commit a8c67a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Authentication/Token/Storage/TokenStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getToken()
3939
*/
4040
public function setToken(TokenInterface $token = null)
4141
{
42-
if (null !== $token && !method_exists($token, 'getRoleNames')) {
42+
if (null !== $token && !method_exists($token, 'getRoleNames') && !$token instanceof \PHPUnit\Framework\MockObject\MockObject && !$token instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
4343
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
4444
}
4545

Tests/Authorization/TraceableAccessDecisionManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function testAccessDecisionManagerCalledByVoter()
233233
->method('vote')
234234
->willReturnCallback(function (TokenInterface $token, $subject, array $attributes) use ($sut, $voter3) {
235235
if (\in_array('attr2', $attributes) && $subject) {
236-
$vote = $sut->decide($token, $attributes);
236+
$vote = $sut->decide($token, $attributes) ? VoterInterface::ACCESS_GRANTED : VoterInterface::ACCESS_DENIED;
237237
} else {
238238
$vote = VoterInterface::ACCESS_ABSTAIN;
239239
}

0 commit comments

Comments
 (0)