From 50d622a45937c3d5d2af696416e18f70d3df7872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Mo=CC=88ller?= Date: Thu, 5 Mar 2015 16:31:30 +0100 Subject: [PATCH] Fix: organizationAction() should be listAction() --- module/ZfModule/config/module.config.php | 2 +- .../ZfModule/Controller/ModuleController.php | 2 +- .../Controller/ModuleControllerTest.php | 20 +++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/module/ZfModule/config/module.config.php b/module/ZfModule/config/module.config.php index 6bf84234..a5814490 100644 --- a/module/ZfModule/config/module.config.php +++ b/module/ZfModule/config/module.config.php @@ -58,7 +58,7 @@ 'owner' => '[a-zA-Z][a-zA-Z0-9_-]*', ], 'defaults' => [ - 'action' => 'organization', + 'action' => 'list', ], ], ], diff --git a/module/ZfModule/src/ZfModule/Controller/ModuleController.php b/module/ZfModule/src/ZfModule/Controller/ModuleController.php index d53653bb..2d98c14b 100644 --- a/module/ZfModule/src/ZfModule/Controller/ModuleController.php +++ b/module/ZfModule/src/ZfModule/Controller/ModuleController.php @@ -98,7 +98,7 @@ public function indexAction() return $viewModel; } - public function organizationAction() + public function listAction() { if (!$this->zfcUserAuthentication()->hasIdentity()) { return $this->redirect()->toRoute('zfcuser/login'); diff --git a/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php b/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php index 1b3ced6a..989ec653 100644 --- a/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php +++ b/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php @@ -168,7 +168,7 @@ public function testIndexActionRendersUnregisteredModulesOnly() $this->assertSame($unregisteredModule, $viewVariable[0]); } - public function testOrganizationActionRedirectsIfNotAuthenticated() + public function testListActionRedirectsIfNotAuthenticated() { $this->notAuthenticated(); @@ -182,13 +182,13 @@ public function testOrganizationActionRedirectsIfNotAuthenticated() $this->dispatch($url); $this->assertControllerName(Controller\ModuleController::class); - $this->assertActionName('organization'); + $this->assertActionName('list'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); $this->assertRedirectTo('/user/login'); } - public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesWhenNoOwnerIsSpecified() + public function testListActionFetches100MostRecentlyUpdatedRepositoriesWhenNoOwnerIsSpecified() { $this->authenticatedAs(new User()); @@ -224,15 +224,15 @@ public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesW $this->dispatch('/module/list'); $this->assertControllerName(Controller\ModuleController::class); - $this->assertActionName('organization'); + $this->assertActionName('list'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); } /** * @dataProvider providerInvalidVendor - * @param $vendor + * @param string $vendor */ - public function testOrganizationActionDoesNotMatchOnInvalidVendor($vendor) + public function testListActionDoesNotMatchOnInvalidVendor($vendor) { $this->authenticatedAs(new User()); @@ -289,7 +289,7 @@ public function providerInvalidVendor() ]; } - public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesWithOwnerSpecified() + public function testListActionFetches100MostRecentlyUpdatedRepositoriesWithOwnerSpecified() { $this->authenticatedAs(new User()); @@ -332,11 +332,11 @@ public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesW $this->dispatch($url); $this->assertControllerName(Controller\ModuleController::class); - $this->assertActionName('organization'); + $this->assertActionName('list'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); } - public function testOrganizationActionRendersUnregisteredModulesOnly() + public function testListActionRendersUnregisteredModulesOnly() { $this->authenticatedAs(new User()); @@ -411,7 +411,7 @@ public function testOrganizationActionRendersUnregisteredModulesOnly() $this->dispatch($url); $this->assertControllerName(Controller\ModuleController::class); - $this->assertActionName('organization'); + $this->assertActionName('list'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); /* @var Mvc\Application $application */