diff --git a/module/Application/test/ApplicationTest/Integration/Controller/ContributorsControllerTest.php b/module/Application/test/ApplicationTest/Integration/Controller/ContributorsControllerTest.php index 9a4d0541..475b631e 100644 --- a/module/Application/test/ApplicationTest/Integration/Controller/ContributorsControllerTest.php +++ b/module/Application/test/ApplicationTest/Integration/Controller/ContributorsControllerTest.php @@ -85,6 +85,8 @@ public function testContributorsActionCanBeAccessed() $this->dispatch('/contributors'); + $this->assertMatchedRouteName('contributors'); + $this->assertControllerName(Controller\ContributorsController::class); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); diff --git a/module/Application/test/ApplicationTest/Integration/Controller/IndexControllerTest.php b/module/Application/test/ApplicationTest/Integration/Controller/IndexControllerTest.php index 8b7da35b..30440631 100644 --- a/module/Application/test/ApplicationTest/Integration/Controller/IndexControllerTest.php +++ b/module/Application/test/ApplicationTest/Integration/Controller/IndexControllerTest.php @@ -69,6 +69,8 @@ public function testIndexActionCanBeAccessed() $this->dispatch('/'); + $this->assertMatchedRouteName('home'); + $this->assertControllerName(Controller\IndexController::class); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); @@ -101,6 +103,8 @@ public function testFeedActionCanBeAccessed() $this->dispatch('/feed'); + $this->assertMatchedRouteName('feed'); + $this->assertControllerName(Controller\IndexController::class); $this->assertActionName('feed'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); diff --git a/module/Application/test/ApplicationTest/Integration/Controller/SearchControllerTest.php b/module/Application/test/ApplicationTest/Integration/Controller/SearchControllerTest.php index b3c1e388..f18527a6 100644 --- a/module/Application/test/ApplicationTest/Integration/Controller/SearchControllerTest.php +++ b/module/Application/test/ApplicationTest/Integration/Controller/SearchControllerTest.php @@ -38,6 +38,8 @@ public function testIndexActionCanBeAccessed() $this->dispatch('/live-search'); + $this->assertMatchedRouteName('live-search'); + $this->assertControllerName(Controller\SearchController::class); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); diff --git a/module/User/test/UserTest/Integration/Controller/UserControllerTest.php b/module/User/test/UserTest/Integration/Controller/UserControllerTest.php index 6dd16310..17732254 100644 --- a/module/User/test/UserTest/Integration/Controller/UserControllerTest.php +++ b/module/User/test/UserTest/Integration/Controller/UserControllerTest.php @@ -32,6 +32,8 @@ public function testIndexActionRedirectsIfNotAuthenticated() $this->dispatch('/user'); + $this->assertMatchedRouteName('scn-social-auth-user'); + $this->assertControllerName('zfcuser'); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -103,6 +105,8 @@ public function testIndexActionSetsModulesIfAuthenticated() $this->dispatch('/user'); + $this->assertMatchedRouteName('scn-social-auth-user'); + $this->assertControllerName('zfcuser'); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); diff --git a/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php b/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php index 989ec653..c83252a9 100644 --- a/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php +++ b/module/ZfModule/test/ZfModuleTest/Integration/Controller/ModuleControllerTest.php @@ -39,6 +39,8 @@ public function testIndexActionRedirectsIfNotAuthenticated() $this->dispatch('/module'); + $this->assertMatchedRouteName('zf-module'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -79,6 +81,8 @@ public function testIndexActionFetches100MostRecentlyUpdatedUserRepositories() $this->dispatch('/module'); + $this->assertMatchedRouteName('zf-module'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); @@ -151,6 +155,8 @@ public function testIndexActionRendersUnregisteredModulesOnly() $this->dispatch('/module'); + $this->assertMatchedRouteName('zf-module'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('index'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); @@ -181,6 +187,8 @@ public function testListActionRedirectsIfNotAuthenticated() $this->dispatch($url); + $this->assertMatchedRouteName('zf-module/list'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('list'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -223,6 +231,8 @@ public function testListActionFetches100MostRecentlyUpdatedRepositoriesWhenNoOwn $this->dispatch('/module/list'); + $this->assertMatchedRouteName('zf-module/list'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('list'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); @@ -331,6 +341,8 @@ public function testListActionFetches100MostRecentlyUpdatedRepositoriesWithOwner $this->dispatch($url); + $this->assertMatchedRouteName('zf-module/list'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('list'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); @@ -410,11 +422,12 @@ public function testListActionRendersUnregisteredModulesOnly() $this->dispatch($url); + $this->assertMatchedRouteName('zf-module/list'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('list'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); - /* @var Mvc\Application $application */ $viewModel = $this->getApplication()->getMvcEvent()->getViewModel(); $this->assertTrue($viewModel->terminate()); @@ -433,6 +446,8 @@ public function testAddActionRedirectsIfNotAuthenticated() $this->dispatch('/module/add'); + $this->assertMatchedRouteName('zf-module/add'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -454,6 +469,8 @@ public function testAddActionThrowsUnexpectedValueExceptionIfNotPostedTo($method $method ); + $this->assertMatchedRouteName('zf-module/add'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -525,6 +542,8 @@ public function testAddActionThrowsRuntimeExceptionIfUnableToFetchRepositoryMeta ] ); + $this->assertMatchedRouteName('zf-module/add'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -586,6 +605,8 @@ public function testAddActionThrowsUnexpectedValueExceptionWhenRepositoryHasInsu ] ); + $this->assertMatchedRouteName('zf-module/add'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -675,6 +696,8 @@ public function testAddActionThrowsUnexpectedValueExceptionWhenRepositoryIsNotAM ] ); + $this->assertMatchedRouteName('zf-module/add'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -759,6 +782,8 @@ public function testAddActionRegistersRepositoryIfPermissionsAreSufficientAndItI ] ); + $this->assertMatchedRouteName('zf-module/add'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('add'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -772,6 +797,8 @@ public function testRemoveActionRedirectsIfNotAuthenticated() $this->dispatch('/module/remove'); + $this->assertMatchedRouteName('zf-module/remove'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -793,6 +820,8 @@ public function testRemoveActionThrowsUnexpectedValueExceptionIfNotPostedTo($met $method ); + $this->assertMatchedRouteName('zf-module/remove'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -846,6 +875,8 @@ public function testRemoveActionThrowsRuntimeExceptionIfUnableToFetchRepositoryM ] ); + $this->assertMatchedRouteName('zf-module/remove'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -907,6 +938,8 @@ public function testRemoveActionThrowsUnexpectedValueExceptionWhenRepositoryHasI ] ); + $this->assertMatchedRouteName('zf-module/remove'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -982,6 +1015,8 @@ public function testRemoveActionThrowsUnexpectedValueExceptionWhenRepositoryNotP ] ); + $this->assertMatchedRouteName('zf-module/remove'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_500); @@ -1067,6 +1102,8 @@ public function testRemoveActionDeletesModuleIfPermissionsAreSufficientAndItHasB ] ); + $this->assertMatchedRouteName('zf-module/remove'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('remove'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_302); @@ -1107,6 +1144,8 @@ public function testViewActionSetsHttp404ResponseCodeIfModuleNotFound() $this->dispatch($url); + $this->assertMatchedRouteName('view-module'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('not-found'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_404); @@ -1164,6 +1203,8 @@ public function testViewActionSetsHttp404ResponseCodeIfRepositoryMetaDataNotFoun $this->dispatch($url); + $this->assertMatchedRouteName('view-module'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('not-found'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_404); @@ -1221,6 +1262,8 @@ public function testViewActionCanBeAccessed() $this->dispatch($url); + $this->assertMatchedRouteName('view-module'); + $this->assertControllerName(Controller\ModuleController::class); $this->assertActionName('view'); } diff --git a/module/ZfModule/test/ZfModuleTest/Integration/Controller/UserControllerTest.php b/module/ZfModule/test/ZfModuleTest/Integration/Controller/UserControllerTest.php index 88032c07..3f7e620e 100644 --- a/module/ZfModule/test/ZfModuleTest/Integration/Controller/UserControllerTest.php +++ b/module/ZfModule/test/ZfModuleTest/Integration/Controller/UserControllerTest.php @@ -59,6 +59,8 @@ public function testUserPageCanBeAccessed() $this->dispatch($url); + $this->assertMatchedRouteName('modules-for-user'); + $this->assertControllerName(Controller\UserController::class); $this->assertActionName('modulesForUser'); $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200);