public function testFromName() { $factory = new RepositoryFactory($this->finder); $repositories = array('first-repo' => '/path', 'second-repo' => '/other-path'); $factory->setRepositories($repositories); $this->assertEquals('/path', $factory->fromName('first-repo'), 'From name returned incorrect value'); }
/** * Get repository data * * @param str $name * @return Response */ public function show($name) { $this->factory->toArray(true); $repository = $this->factory->fromName($name); return Response::json(array('name' => $repository->getName(), 'branch' => $repository->getCurrentBranch(), 'data' => $repository->statistics())); }