/** * List of groups */ public function testGroupsList() { // Create 5 groups for the same owner $owner = UserFactory::createUser(); $groups = array(); $n = 5; for ($i = 0; $i < $n; $i++) { $groups[] = GroupsFactory::createGroup($owner); } // Create a group for another user GroupsFactory::createGroup(); // Call API $response = GroupController::apiList(new Request(array("auth_token" => self::login($owner)))); $this->assertEquals($n, count($response["groups"])); }