eZ\Publish\Core\Persistence\Legacy\Tests\User\UserHandlerTest::testAddPolicyPolicyId PHP Method

testAddPolicyPolicyId() public method

    public function testAddPolicyPolicyId()
    {
        $handler = $this->getUserHandler();
        $createStruct = new Persistence\User\RoleCreateStruct();
        $createStruct->identifier = 'Test';
        $roleDraft = $handler->createRole($createStruct);
        $handler->publishRoleDraft($roleDraft->id);
        $role = $handler->loadRole($roleDraft->id);
        $policy = new Persistence\User\Policy();
        $policy->module = 'foo';
        $policy->function = 'bar';
        $policy = $handler->addPolicy($role->id, $policy);
        $this->assertEquals(1, $policy->id);
    }