diff --git a/module/ZfModule/config/module.config.php b/module/ZfModule/config/module.config.php index 639160b7..6bf84234 100644 --- a/module/ZfModule/config/module.config.php +++ b/module/ZfModule/config/module.config.php @@ -10,7 +10,7 @@ return [ 'controllers' => [ 'factories' => [ - Controller\IndexController::class => Controller\IndexControllerFactory::class, + Controller\ModuleController::class => Controller\ModuleControllerFactory::class, Controller\UserController::class => Controller\UserControllerFactory::class, ], ], @@ -21,7 +21,7 @@ 'options' => [ 'route' => '/:vendor/:module', 'defaults' => [ - 'controller' => Controller\IndexController::class, + 'controller' => Controller\ModuleController::class, 'action' => 'view', ], ], @@ -44,7 +44,7 @@ 'options' => [ 'route' => '/module', 'defaults' => [ - 'controller' => Controller\IndexController::class, + 'controller' => Controller\ModuleController::class, 'action' => 'index', ], ], diff --git a/module/ZfModule/src/ZfModule/Controller/IndexController.php b/module/ZfModule/src/ZfModule/Controller/ModuleController.php similarity index 99% rename from module/ZfModule/src/ZfModule/Controller/IndexController.php rename to module/ZfModule/src/ZfModule/Controller/ModuleController.php index 9c644a2d..3c25ca2d 100644 --- a/module/ZfModule/src/ZfModule/Controller/IndexController.php +++ b/module/ZfModule/src/ZfModule/Controller/ModuleController.php @@ -16,7 +16,7 @@ * @method Http\Request getRequest() * @method Plugin\ZfcUserAuthentication zfcUserAuthentication() */ -class IndexController extends AbstractActionController +class ModuleController extends AbstractActionController { /** * @var Mapper\Module diff --git a/module/ZfModule/src/ZfModule/Controller/IndexControllerFactory.php b/module/ZfModule/src/ZfModule/Controller/ModuleControllerFactory.php similarity index 89% rename from module/ZfModule/src/ZfModule/Controller/IndexControllerFactory.php rename to module/ZfModule/src/ZfModule/Controller/ModuleControllerFactory.php index 9c8b2bbf..567964c5 100644 --- a/module/ZfModule/src/ZfModule/Controller/IndexControllerFactory.php +++ b/module/ZfModule/src/ZfModule/Controller/ModuleControllerFactory.php @@ -9,11 +9,11 @@ use ZfModule\Mapper; use ZfModule\Service; -class IndexControllerFactory implements FactoryInterface +class ModuleControllerFactory implements FactoryInterface { /** * @param ServiceLocatorInterface $controllerManager - * @return IndexController + * @return ModuleController */ public function createService(ServiceLocatorInterface $controllerManager) { @@ -29,7 +29,7 @@ public function createService(ServiceLocatorInterface $controllerManager) /* @var RepositoryRetriever $repositoryRetriever */ $repositoryRetriever = $serviceManager->get(RepositoryRetriever::class); - return new IndexController( + return new ModuleController( $moduleMapper, $moduleService, $repositoryRetriever diff --git a/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php b/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php similarity index 95% rename from module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php rename to module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php index f661445a..c1b2dcb5 100644 --- a/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php +++ b/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php @@ -22,7 +22,7 @@ /** * @method Mvc\Application getApplication() */ -class IndexControllerTest extends AbstractHttpControllerTestCase +class ModuleControllerTest extends AbstractHttpControllerTestCase { use AuthenticationTrait; @@ -39,7 +39,7 @@ public function testIndexActionRedirectsIfNotAuthenticated() $this->dispatch('/module'); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -79,7 +79,7 @@ public function testIndexActionFetches100MostRecentlyUpdatedUserRepositories() $this->dispatch('/module'); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); } @@ -151,7 +151,7 @@ public function testIndexActionRendersUnregisteredModulesOnly() $this->dispatch('/module'); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); @@ -181,7 +181,7 @@ public function testOrganizationActionRedirectsIfNotAuthenticated() $this->dispatch($url); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('organization'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -223,7 +223,7 @@ public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesW $this->dispatch('/module/list'); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('organization'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); } @@ -331,7 +331,7 @@ public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesW $this->dispatch($url); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('organization'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); } @@ -410,7 +410,7 @@ public function testOrganizationActionRendersUnregisteredModulesOnly() $this->dispatch($url); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('organization'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); @@ -433,7 +433,7 @@ public function testAddActionRedirectsIfNotAuthenticated() $this->dispatch('/module/add'); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -454,7 +454,7 @@ public function testAddActionThrowsUnexpectedValueExceptionIfNotPostedTo($method $method ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -525,7 +525,7 @@ public function testAddActionThrowsRuntimeExceptionIfUnableToFetchRepositoryMeta ] ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -586,7 +586,7 @@ public function testAddActionThrowsUnexpectedValueExceptionWhenRepositoryHasInsu ] ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -675,7 +675,7 @@ public function testAddActionThrowsUnexpectedValueExceptionWhenRepositoryIsNotAM ] ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -759,7 +759,7 @@ public function testAddActionRegistersRepositoryIfPermissionsAreSufficientAndItI ] ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -772,7 +772,7 @@ public function testRemoveActionRedirectsIfNotAuthenticated() $this->dispatch('/module/remove'); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -793,7 +793,7 @@ public function testRemoveActionThrowsUnexpectedValueExceptionIfNotPostedTo($met $method ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -846,7 +846,7 @@ public function testRemoveActionThrowsRuntimeExceptionIfUnableToFetchRepositoryM ] ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -907,7 +907,7 @@ public function testRemoveActionThrowsUnexpectedValueExceptionWhenRepositoryHasI ] ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -982,7 +982,7 @@ public function testRemoveActionThrowsUnexpectedValueExceptionWhenRepositoryNotP ] ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -1067,7 +1067,7 @@ public function testRemoveActionDeletesModuleIfPermissionsAreSufficientAndItHasB ] ); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -1107,7 +1107,7 @@ public function testViewActionSetsHttp404ResponseCodeIfModuleNotFound() $this->dispatch($url); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('not-found'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_404); } @@ -1164,7 +1164,7 @@ public function testViewActionSetsHttp404ResponseCodeIfRepositoryMetaDataNotFoun $this->dispatch($url); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('not-found'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_404); } @@ -1221,7 +1221,7 @@ public function testViewActionCanBeAccessed() $this->dispatch($url); - $this->assertControllerName(Controller\IndexController::class); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('view'); }