public function testXListUsersAction()
{
$acl = \Scalr::getContainer()->acl;
$chk = $this->_chk();
//Without any filter
$response = $this->internalRequest('/account/users/xListUsers');
$this->assertResponseDataHasKeys($chk, $response, true);
//Filter by team
$teams = $this->getUser()->getTeams();
if (!empty($teams)) {
$sr = $this->internalRequest('/account/users/xListUsers?teamId=' . $teams[0]['id']);
$this->assertResponseDataHasKeys($chk, $sr, true);
}
//Filter by role
$roles = $acl->getAccountRoles($this->getUser()->getAccountId());
if (!empty($roles)) {
list($accountRoleId) = each($roles);
} else {
$accountRoleId = 'anything';
}
$sr2 = $this->internalRequest('/account/users/xListUsers?groupPermissionId=' . urlencode($accountRoleId));
$this->assertResponseDataHasKeys($chk, $sr2, true);
}