/** * List of groups */ public function testGroupsMyList() { // 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::apiMyList(new Request(array('auth_token' => self::login($owner)))); $this->assertEquals($n, count($response['groups'])); }