Skip to content

Commit

Permalink
Fix test for MenuHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
alterphp committed Nov 5, 2018
1 parent 9a18dcb commit 4797649
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Helper/MenuHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use AlterPHP\EasyAdminExtensionBundle\Helper\MenuHelper;
use AlterPHP\EasyAdminExtensionBundle\Security\AdminAuthorizationChecker;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;

class MenuHelperTest extends TestCase
{
Expand Down Expand Up @@ -36,6 +37,7 @@ class MenuHelperTest extends TestCase
public function testAcessDeniedEntriesArePruned()
{
$adminAuthorizationChecker = $this->createMock(AdminAuthorizationChecker::class);
$symfonyAuthorizationChecker = $this->createMock(AuthorizationChecker::class);

$grantedRoleMap = array(
array($this->entitiesConfig['Organization'], 'list', null, true),
Expand All @@ -48,7 +50,7 @@ public function testAcessDeniedEntriesArePruned()
);
$adminAuthorizationChecker->method('isEasyAdminGranted')->will($this->returnValueMap($grantedRoleMap));

$helper = new MenuHelper($adminAuthorizationChecker);
$helper = new MenuHelper($adminAuthorizationChecker, $symfonyAuthorizationChecker);

$prunedMenu = $helper->pruneMenuItems($this->menuConfig, $this->entitiesConfig);

Expand Down

0 comments on commit 4797649

Please sign in to comment.