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

Commit

Permalink
Fix: Rename IndexController to ModuleController
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Mar 5, 2015
1 parent ad5283f commit 40bc336
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions module/ZfModule/config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
],
Expand All @@ -21,7 +21,7 @@
'options' => [
'route' => '/:vendor/:module',
'defaults' => [
'controller' => Controller\IndexController::class,
'controller' => Controller\ModuleController::class,
'action' => 'view',
],
],
Expand All @@ -44,7 +44,7 @@
'options' => [
'route' => '/module',
'defaults' => [
'controller' => Controller\IndexController::class,
'controller' => Controller\ModuleController::class,
'action' => 'index',
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @method Http\Request getRequest()
* @method Plugin\ZfcUserAuthentication zfcUserAuthentication()
*/
class IndexController extends AbstractActionController
class ModuleController extends AbstractActionController
{
/**
* @var Mapper\Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* @method Mvc\Application getApplication()
*/
class IndexControllerTest extends AbstractHttpControllerTestCase
class ModuleControllerTest extends AbstractHttpControllerTestCase
{
use AuthenticationTrait;

Expand All @@ -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);

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -1221,7 +1221,7 @@ public function testViewActionCanBeAccessed()

$this->dispatch($url);

$this->assertControllerName(Controller\IndexController::class);
$this->assertControllerName(Controller\ModuleController::class);
$this->assertActionName('view');
}

Expand Down

0 comments on commit 40bc336

Please sign in to comment.