public function testAddPolicyLimitations()
{
$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->limitations = array('Subtree' => array('/1', '/1/2'), 'Foo' => array('Bar'));
$handler->addPolicy($role->id, $policy);
$this->assertQueryResult(array(array(1, 'Subtree', 1), array(2, 'Foo', 1)), $this->handler->createSelectQuery()->select('id', 'identifier', 'policy_id')->from('ezpolicy_limitation'), 'Expected a new policy.');
}