public function testAddPolicyLimitationValues()
{
$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, '/1', 1), array(2, '/1/2', 1), array(3, 'Bar', 2)), $this->handler->createSelectQuery()->select('id', 'value', 'limitation_id')->from('ezpolicy_limitation_value'), 'Expected a new policy.');
}