Skip to content

Commit f7d4a14

Browse files
committed
[Security] Backport 6.0 compat fixes
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent bfc8cf4 commit f7d4a14

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector;
1616
use Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener;
17+
use Symfony\Bundle\SecurityBundle\DependencyInjection\MainConfiguration;
1718
use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
1819
use Symfony\Bundle\SecurityBundle\Security\FirewallMap;
1920
use Symfony\Component\EventDispatcher\EventDispatcher;
@@ -24,7 +25,6 @@
2425
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
2526
use Symfony\Component\Security\Core\Authentication\Token\SwitchUserToken;
2627
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
27-
use Symfony\Component\Security\Core\Authorization\AccessDecisionManager;
2828
use Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager;
2929
use Symfony\Component\Security\Core\Authorization\Voter\TraceableVoter;
3030
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
@@ -231,7 +231,7 @@ public function providerCollectDecisionLog(): \Generator
231231
$decoratedVoter1 = new TraceableVoter($voter1, $eventDispatcher);
232232

233233
yield [
234-
AccessDecisionManager::STRATEGY_AFFIRMATIVE,
234+
MainConfiguration::STRATEGY_AFFIRMATIVE,
235235
[[
236236
'attributes' => ['view'],
237237
'object' => new \stdClass(),
@@ -255,7 +255,7 @@ public function providerCollectDecisionLog(): \Generator
255255
];
256256

257257
yield [
258-
AccessDecisionManager::STRATEGY_UNANIMOUS,
258+
MainConfiguration::STRATEGY_UNANIMOUS,
259259
[
260260
[
261261
'attributes' => ['view', 'edit'],

src/Symfony/Component/Security/Core/Tests/Authorization/TraceableAccessDecisionManagerTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1616
use Symfony\Component\Security\Core\Authorization\AccessDecisionManager;
17+
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
1718
use Symfony\Component\Security\Core\Authorization\DebugAccessDecisionManager;
1819
use Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager;
1920
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
@@ -26,11 +27,7 @@ class TraceableAccessDecisionManagerTest extends TestCase
2627
public function testDecideLog(array $expectedLog, array $attributes, $object, array $voterVotes, bool $result)
2728
{
2829
$token = $this->createMock(TokenInterface::class);
29-
30-
$admMock = $this
31-
->getMockBuilder(AccessDecisionManager::class)
32-
->setMethods(['decide'])
33-
->getMock();
30+
$admMock = $this->createMock(AccessDecisionManagerInterface::class);
3431

3532
$adm = new TraceableAccessDecisionManager($admMock);
3633

0 commit comments

Comments
 (0)