diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php index 1e34fa1fa..ec749f725 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php @@ -38,7 +38,10 @@ final class SavedExportVoter extends Voter self::DUPLICATE, ]; - public function __construct(private readonly ExportManager $exportManager, private readonly AccessDecisionManagerInterface $accessDecisionManager) {} + public function __construct( + private readonly ExportManager $exportManager, + private readonly AccessDecisionManagerInterface $accessDecisionManager, + ) {} protected function supports($attribute, $subject): bool { diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/SavedExportVoterTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/SavedExportVoterTest.php index efa2312cd..f2eefa055 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/SavedExportVoterTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/SavedExportVoterTest.php @@ -21,6 +21,7 @@ use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; +use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; /** @@ -42,7 +43,9 @@ class SavedExportVoterTest extends TestCase $exportManager->getExport('dummy_export')->willReturn($export->reveal()); $exportManager->isGrantedForElement(Argument::any())->willReturn($isGranted); - $voter = new SavedExportVoter($exportManager->reveal()); + $accessDecisionManager = $this->prophesize(AccessDecisionManagerInterface::class); + + $voter = new SavedExportVoter($exportManager->reveal(), $accessDecisionManager->reveal()); $token = new UsernamePasswordToken($user, 'default', ['ROLE_USER']); self::assertEquals($expectedResult, $voter->vote($token, $savedExport, [$attribute]));