Skip to content

Commit a8d09b4

Browse files
Merge branch '4.3' into 4.4
* 4.3: (23 commits) fix merge [SecurityBundle] fix return type declarations [BrowserKit] fix return type declarations [PropertyInfo] fix return type declarations [Bridge/Doctrine] fix return type declarations [Form] fix return type declarations [Console] fix return type declarations [Intl] fix return type declarations [Templating] fix return type declarations [DomCrawler] fix return type declarations [Validator] fix return type declarations [Process] fix return type declarations [Workflow] fix return type declarations [Cache] fix return type declarations [Serializer] fix return type declarations [Translation] fix return type declarations [DI] fix return type declarations [Config] fix return type declarations [HttpKernel] Fix return type declarations [Security] Fix return type declarations ...
2 parents cedb4c4 + a8c67a8 commit a8d09b4

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-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/Authentication/Provider/DaoAuthenticationProviderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
class DaoAuthenticationProviderTest extends TestCase
2424
{
25+
/**
26+
* @group legacy
27+
*/
2528
public function testRetrieveUserWhenProviderDoesNotReturnAnUserInterface()
2629
{
2730
$this->expectException('Symfony\Component\Security\Core\Exception\AuthenticationServiceException');

Tests/Authentication/Provider/UserAuthenticationProviderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public function testAuthenticateWhenUsernameIsNotFoundAndHideIsTrue()
6262
$provider->authenticate($this->getSupportedToken());
6363
}
6464

65+
/**
66+
* @group legacy
67+
*/
6568
public function testAuthenticateWhenProviderDoesNotReturnAnUserInterface()
6669
{
6770
$this->expectException('Symfony\Component\Security\Core\Exception\AuthenticationServiceException');

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)