public function let(OrganizationInfo $organization, RepositoryCollection $repositoryCollection) { $organization->getOrganizationName()->willReturn('owner-name'); $repositoryCollection->count()->willReturn(1); $this->beConstructedWith($organization, $repositoryCollection); }
/** * @param OrganizationInfo $organization * * @return RepositoryCollection */ private function fetchOrganizationRepos(OrganizationInfo $organization) { $orgRepos = $this->getClient()->organization()->repositories($organization->getOrganizationName()); $results = new RepositoryCollection(); foreach ($orgRepos as $repoData) { $repoInfo = new RepoInfo($repoData['owner']['login'], $repoData['name']); $results->add($repoInfo); } return $results; }