Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function findProjects($name)
 {
     return $this->requestProjects($name, function ($name) {
         list($user) = explode('/', $name);
         return $this->client->user()->repositories($user);
     }, 'full_name');
 }
 public function it_returns_a_list_of_Projects_on_findProjects(Client $client, Repo $repoApi, User $userApi)
 {
     $client->repos()->willReturn($repoApi);
     $repoApi->show('foo', 'bar')->willReturn(['full_name' => 'foo/bar']);
     $client->user()->willReturn($userApi);
     $userApi->repositories('foo')->willReturn([['full_name' => 'foo/bar']]);
     $projects = $this->findProjects('foo/[bar|bazz]+$');
     $projects->shouldBeArray();
     $projects['foo/bar']->shouldHaveType('Rs\\Issues\\Project');
     $projects['foo/bar']->shouldHaveType('Rs\\Issues\\Github\\GithubProject');
 }
 public function calculateStarGazersByUsername($username)
 {
     $repositories = $this->client->user()->repositories($username);
     $repositories = $this->filterForkedRepositories($repositories);
     return $this->addStarGazersFromRepositories($repositories);
 }