Skip to content

Commit 748f09a

Browse files
committed
test(symfony): remove exceptionOnNoToken on non-legacy tests
1 parent 37abce0 commit 748f09a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Symfony/Security/ResourceAccessChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(ExpressionLanguage $expressionLanguage = null, Authe
4444
$this->tokenStorage = $tokenStorage;
4545
$this->authorizationChecker = $authorizationChecker;
4646

47-
if (5 < func_num_args()) {
47+
if (5 < \func_num_args()) {
4848
$this->exceptionOnNoToken = $exceptionOnNoToken;
4949
trigger_deprecation('api-platform/core', '2.7', 'The $exceptionOnNoToken parameter in "%s()" is deprecated and will always be false in 3.0, you should stop using it.', __METHOD__);
5050
}

tests/Symfony/Security/ResourceAccessCheckerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testIsGranted(bool $granted)
5858

5959
$tokenStorageProphecy->getToken()->willReturn($token);
6060

61-
$checker = new ResourceAccessChecker($expressionLanguageProphecy->reveal(), $authenticationTrustResolverProphecy->reveal(), null, $tokenStorageProphecy->reveal(), null, false);
61+
$checker = new ResourceAccessChecker($expressionLanguageProphecy->reveal(), $authenticationTrustResolverProphecy->reveal(), null, $tokenStorageProphecy->reveal(), null);
6262
$this->assertSame($granted, $checker->isGranted(Dummy::class, 'is_granted("ROLE_ADMIN")'));
6363
}
6464

@@ -72,7 +72,7 @@ public function testSecurityComponentNotAvailable()
7272
$this->expectException(\LogicException::class);
7373
$this->expectExceptionMessage('The "symfony/security" library must be installed to use the "security" attribute.');
7474

75-
$checker = new ResourceAccessChecker($this->prophesize(ExpressionLanguage::class)->reveal(), null, null, null, null, false);
75+
$checker = new ResourceAccessChecker($this->prophesize(ExpressionLanguage::class)->reveal(), null, null, null, null);
7676
$checker->isGranted(Dummy::class, 'is_granted("ROLE_ADMIN")');
7777
}
7878

@@ -85,7 +85,7 @@ public function testExpressionLanguageNotInstalled()
8585
$tokenStorageProphecy = $this->prophesize(TokenStorageInterface::class);
8686
$tokenStorageProphecy->getToken()->willReturn($this->prophesize(TokenInterface::class)->willImplement(Serializable::class)->reveal());
8787

88-
$checker = new ResourceAccessChecker(null, $authenticationTrustResolverProphecy->reveal(), null, $tokenStorageProphecy->reveal(), null, false);
88+
$checker = new ResourceAccessChecker(null, $authenticationTrustResolverProphecy->reveal(), null, $tokenStorageProphecy->reveal(), null);
8989
$checker->isGranted(Dummy::class, 'is_granted("ROLE_ADMIN")');
9090
}
9191

@@ -116,7 +116,7 @@ public function testWithoutAuthenticationTokenAndExceptionOnNoTokenIsFalse()
116116

117117
$tokenStorageProphecy->getToken()->willReturn(null);
118118

119-
$checker = new ResourceAccessChecker($expressionLanguageProphecy->reveal(), $authenticationTrustResolverProphecy->reveal(), null, $tokenStorageProphecy->reveal(), $authorizationCheckerProphecy->reveal(), false);
119+
$checker = new ResourceAccessChecker($expressionLanguageProphecy->reveal(), $authenticationTrustResolverProphecy->reveal(), null, $tokenStorageProphecy->reveal(), $authorizationCheckerProphecy->reveal());
120120
self::assertTrue($checker->isGranted(Dummy::class, 'is_granted("ROLE_ADMIN")'));
121121
}
122122
}

0 commit comments

Comments
 (0)