Skip to content
This repository was archived by the owner on May 1, 2019. It is now read-only.

List of repositories from Github #353

Merged
merged 5 commits into from
Mar 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions module/ZfModule/src/ZfModule/Controller/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ private function unregisteredRepositories(RepositoryCollection $repositories)
return false;
}

if (!$this->moduleService->isModule($repository)) {
return false;
}

if ($this->moduleMapper->findByName($repository->name)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,18 @@ public function testIndexActionFetches100MostRecentlyUpdatedUserRepositories()
$this->assertResponseStatusCode(Http\Response::STATUS_CODE_200);
}

public function testIndexActionRendersValidModulesOnly()
public function testIndexActionRendersUnregisteredModulesOnly()
{
$this->authenticatedAs(new User());

$validModule = $this->validModule();

$nonModule = $this->nonModule();
$unregisteredModule = $this->validModule();
$registeredModule = $this->registeredModule();

$repositories = [
$validModule,
$nonModule,
$unregisteredModule,
$registeredModule,
$this->forkedModule(),
$this->moduleWithoutPushPermissions(),
$this->forkedModule(),
];

$repositoryCollection = $this->repositoryCollectionMock($repositories);
Expand All @@ -119,18 +116,6 @@ public function testIndexActionRendersValidModulesOnly()
->getMock()
;

$moduleService
->expects($this->any())
->method('isModule')
->willReturnCallback(function ($repository) use ($nonModule) {
if ($repository !== $nonModule) {
return true;
}

return false;
})
;

$moduleMapper = $this->getMockBuilder(Mapper\Module::class)
->disableOriginalConstructor()
->getMock()
Expand Down Expand Up @@ -180,7 +165,7 @@ public function testIndexActionRendersValidModulesOnly()

$this->assertInternalType('array', $viewVariable);
$this->assertCount(1, $viewVariable);
$this->assertSame($validModule, $viewVariable[0]);
$this->assertSame($unregisteredModule, $viewVariable[0]);
}

public function testOrganizationActionRedirectsIfNotAuthenticated()
Expand Down Expand Up @@ -290,18 +275,15 @@ public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesW
$this->assertResponseStatusCode(Http\Response::STATUS_CODE_200);
}

public function testOrganizationActionRendersValidModulesOnly()
public function testOrganizationActionRendersUnregisteredModulesOnly()
{
$this->authenticatedAs(new User());

$validModule = $this->validModule();

$nonModule = $this->nonModule();
$unregisteredModule = $this->validModule();
$registeredModule = $this->registeredModule();

$repositories = [
$validModule,
$nonModule,
$unregisteredModule,
$registeredModule,
$this->forkedModule(),
$this->moduleWithoutPushPermissions(),
Expand All @@ -327,18 +309,6 @@ public function testOrganizationActionRendersValidModulesOnly()
->getMock()
;

$moduleService
->expects($this->any())
->method('isModule')
->willReturnCallback(function ($repository) use ($nonModule) {
if ($repository !== $nonModule) {
return true;
}

return false;
})
;

$moduleMapper = $this->getMockBuilder(Mapper\Module::class)
->disableOriginalConstructor()
->getMock()
Expand Down Expand Up @@ -393,7 +363,7 @@ public function testOrganizationActionRendersValidModulesOnly()

$this->assertInternalType('array', $viewVariable);
$this->assertCount(1, $viewVariable);
$this->assertSame($validModule, $viewVariable[0]);
$this->assertSame($unregisteredModule, $viewVariable[0]);
}

public function testAddActionRedirectsIfNotAuthenticated()
Expand Down