diff --git a/module/ZfModule/src/ZfModule/Controller/IndexController.php b/module/ZfModule/src/ZfModule/Controller/IndexController.php index 4f64489c..9c644a2d 100644 --- a/module/ZfModule/src/ZfModule/Controller/IndexController.php +++ b/module/ZfModule/src/ZfModule/Controller/IndexController.php @@ -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; } diff --git a/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php b/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php index 37be1bca..164c4f4b 100644 --- a/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php +++ b/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php @@ -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); @@ -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() @@ -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() @@ -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(), @@ -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() @@ -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()