/** * Details of a group */ public function testGroupDetails() { // Create a group with 5 users $groupData = GroupsFactory::createGroup(); $users = array(); $nUsers = 5; for ($i = 0; $i < $nUsers; $i++) { $users[] = UserFactory::createUser(); GroupsFactory::addUserToGroup($groupData, $users[$i]); } // Call API $response = GroupController::apiDetails(new Request(array('auth_token' => self::login($groupData['owner']), 'group_alias' => $groupData['group']->alias))); $this->assertEquals($groupData['group']->group_id, $response['group']['group_id']); $response = GroupController::apiMembers(new Request(array('auth_token' => self::login($groupData['owner']), 'group_alias' => $groupData['group']->alias))); $this->assertEquals($nUsers, count($response['users'])); }