eZ\Bundle\EzPublishCoreBundle\Tests\DependencyInjection\EzPublishCoreExtensionTest::testRegisteredPolicies PHP Method

testRegisteredPolicies() public method

    public function testRegisteredPolicies()
    {
        $policies1 = ['custom_module' => ['custom_function_1' => null, 'custom_function_2' => ['CustomLimitation']], 'helloworld' => ['foo' => ['bar'], 'baz' => null]];
        $this->extension->addPolicyProvider(new StubPolicyProvider($policies1));
        $policies2 = ['custom_module2' => ['custom_function_3' => null, 'custom_function_4' => ['CustomLimitation2', 'CustomLimitation3']], 'helloworld' => ['foo' => ['additional_limitation'], 'some' => ['thingy', 'thing', 'but', 'wait']]];
        $this->extension->addPolicyProvider(new StubPolicyProvider($policies2));
        $expectedPolicies = ['custom_module' => ['custom_function_1' => [], 'custom_function_2' => ['CustomLimitation' => true]], 'helloworld' => ['foo' => ['bar' => true, 'additional_limitation' => true], 'baz' => [], 'some' => ['thingy' => true, 'thing' => true, 'but' => true, 'wait' => true]], 'custom_module2' => ['custom_function_3' => [], 'custom_function_4' => ['CustomLimitation2' => true, 'CustomLimitation3' => true]]];
        $this->load();
        self::assertContainerBuilderHasParameter('ezpublish.api.role.policy_map');
        self::assertEquals($expectedPolicies, $this->container->getParameter('ezpublish.api.role.policy_map'));
    }