public function testAddRoleToUserWithComplexLimitation()
{
$handler = $this->getUserHandler();
$roleDraft = $this->createRole();
$handler->publishRoleDraft($roleDraft->id);
$role = $handler->loadRole($roleDraft->id);
$handler->create($user = $this->getValidUser());
$handler->assignRole($user->id, $role->id, array('Subtree' => array('/1', '/1/2'), 'Foo' => array('Bar')));
$this->assertQueryResult(array(array(1, 42, 1, 'Subtree', '/1'), array(2, 42, 1, 'Subtree', '/1/2'), array(3, 42, 1, 'Foo', 'Bar')), $this->handler->createSelectQuery()->select('id', 'contentobject_id', 'role_id', 'limit_identifier', 'limit_value')->from('ezuser_role'), 'Expected a new user policy association.');
}