Skip to content

Instantly share code, notes, and snippets.

@theMadness
Created November 14, 2018 20:27
Show Gist options
  • Save theMadness/267e4f943dc83cfa55b0f71546a5eed2 to your computer and use it in GitHub Desktop.
Save theMadness/267e4f943dc83cfa55b0f71546a5eed2 to your computer and use it in GitHub Desktop.
<?php
namespace Tests\AppBundle\DependencyInjection\Compiler;
use AppBundle\Security\DeepRoleChecker;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class OverrideServiceCompilerPassTest extends KernelTestCase
{
public function testRoleCanEditResourceInjection(): void
{
$kernel = static::bootKernel();
$roleChecker = $kernel->getContainer()->get(DeepRoleChecker::class);
$this->assertFalse($roleChecker->rolesContain(['ROLE_TO_EXTEND'], 'ROLE_CAN_EDIT_SOME_RESOURCE'));
$this->assertFalse($roleChecker->rolesContain(['ROLE_TO_EXTEND'], 'ROLE_CAN_DELETE_SOME_RESOURCE'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment