@@ -39,6 +39,8 @@ public function testIndexActionRedirectsIfNotAuthenticated()
39
39
40
40
$ this ->dispatch ('/module ' );
41
41
42
+ $ this ->assertMatchedRouteName ('zf-module ' );
43
+
42
44
$ this ->assertControllerName (Controller \ModuleController::class);
43
45
$ this ->assertActionName ('index ' );
44
46
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_302 );
@@ -79,6 +81,8 @@ public function testIndexActionFetches100MostRecentlyUpdatedUserRepositories()
79
81
80
82
$ this ->dispatch ('/module ' );
81
83
84
+ $ this ->assertMatchedRouteName ('zf-module ' );
85
+
82
86
$ this ->assertControllerName (Controller \ModuleController::class);
83
87
$ this ->assertActionName ('index ' );
84
88
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_200 );
@@ -151,6 +155,8 @@ public function testIndexActionRendersUnregisteredModulesOnly()
151
155
152
156
$ this ->dispatch ('/module ' );
153
157
158
+ $ this ->assertMatchedRouteName ('zf-module ' );
159
+
154
160
$ this ->assertControllerName (Controller \ModuleController::class);
155
161
$ this ->assertActionName ('index ' );
156
162
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_200 );
@@ -181,6 +187,8 @@ public function testListActionRedirectsIfNotAuthenticated()
181
187
182
188
$ this ->dispatch ($ url );
183
189
190
+ $ this ->assertMatchedRouteName ('zf-module/list ' );
191
+
184
192
$ this ->assertControllerName (Controller \ModuleController::class);
185
193
$ this ->assertActionName ('list ' );
186
194
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_302 );
@@ -223,6 +231,8 @@ public function testListActionFetches100MostRecentlyUpdatedRepositoriesWhenNoOwn
223
231
224
232
$ this ->dispatch ('/module/list ' );
225
233
234
+ $ this ->assertMatchedRouteName ('zf-module/list ' );
235
+
226
236
$ this ->assertControllerName (Controller \ModuleController::class);
227
237
$ this ->assertActionName ('list ' );
228
238
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_200 );
@@ -331,6 +341,8 @@ public function testListActionFetches100MostRecentlyUpdatedRepositoriesWithOwner
331
341
332
342
$ this ->dispatch ($ url );
333
343
344
+ $ this ->assertMatchedRouteName ('zf-module/list ' );
345
+
334
346
$ this ->assertControllerName (Controller \ModuleController::class);
335
347
$ this ->assertActionName ('list ' );
336
348
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_200 );
@@ -410,11 +422,12 @@ public function testListActionRendersUnregisteredModulesOnly()
410
422
411
423
$ this ->dispatch ($ url );
412
424
425
+ $ this ->assertMatchedRouteName ('zf-module/list ' );
426
+
413
427
$ this ->assertControllerName (Controller \ModuleController::class);
414
428
$ this ->assertActionName ('list ' );
415
429
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_200 );
416
430
417
- /* @var Mvc\Application $application */
418
431
$ viewModel = $ this ->getApplication ()->getMvcEvent ()->getViewModel ();
419
432
420
433
$ this ->assertTrue ($ viewModel ->terminate ());
@@ -433,6 +446,8 @@ public function testAddActionRedirectsIfNotAuthenticated()
433
446
434
447
$ this ->dispatch ('/module/add ' );
435
448
449
+ $ this ->assertMatchedRouteName ('zf-module/add ' );
450
+
436
451
$ this ->assertControllerName (Controller \ModuleController::class);
437
452
$ this ->assertActionName ('add ' );
438
453
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_302 );
@@ -454,6 +469,8 @@ public function testAddActionThrowsInvalidDataExceptionIfNotPostedTo($method)
454
469
$ method
455
470
);
456
471
472
+ $ this ->assertMatchedRouteName ('zf-module/add ' );
473
+
457
474
$ this ->assertControllerName (Controller \ModuleController::class);
458
475
$ this ->assertActionName ('add ' );
459
476
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_500 );
@@ -525,6 +542,8 @@ public function testAddActionThrowsRepositoryExceptionIfUnableToFetchRepositoryM
525
542
]
526
543
);
527
544
545
+ $ this ->assertMatchedRouteName ('zf-module/add ' );
546
+
528
547
$ this ->assertControllerName (Controller \ModuleController::class);
529
548
$ this ->assertActionName ('add ' );
530
549
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_500 );
@@ -586,6 +605,8 @@ public function testAddActionThrowsRepositoryExceptionWhenRepositoryHasInsuffici
586
605
]
587
606
);
588
607
608
+ $ this ->assertMatchedRouteName ('zf-module/add ' );
609
+
589
610
$ this ->assertControllerName (Controller \ModuleController::class);
590
611
$ this ->assertActionName ('add ' );
591
612
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_500 );
@@ -675,6 +696,8 @@ public function testAddActionThrowsRepositoryExceptionWhenRepositoryIsNotAModule
675
696
]
676
697
);
677
698
699
+ $ this ->assertMatchedRouteName ('zf-module/add ' );
700
+
678
701
$ this ->assertControllerName (Controller \ModuleController::class);
679
702
$ this ->assertActionName ('add ' );
680
703
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_500 );
@@ -759,6 +782,8 @@ public function testAddActionRegistersRepositoryIfPermissionsAreSufficientAndItI
759
782
]
760
783
);
761
784
785
+ $ this ->assertMatchedRouteName ('zf-module/add ' );
786
+
762
787
$ this ->assertControllerName (Controller \ModuleController::class);
763
788
$ this ->assertActionName ('add ' );
764
789
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_302 );
@@ -772,6 +797,8 @@ public function testRemoveActionRedirectsIfNotAuthenticated()
772
797
773
798
$ this ->dispatch ('/module/remove ' );
774
799
800
+ $ this ->assertMatchedRouteName ('zf-module/remove ' );
801
+
775
802
$ this ->assertControllerName (Controller \ModuleController::class);
776
803
$ this ->assertActionName ('remove ' );
777
804
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_302 );
@@ -793,6 +820,8 @@ public function testRemoveActionThrowsInvalidDataExceptionIfNotPostedTo($method)
793
820
$ method
794
821
);
795
822
823
+ $ this ->assertMatchedRouteName ('zf-module/remove ' );
824
+
796
825
$ this ->assertControllerName (Controller \ModuleController::class);
797
826
$ this ->assertActionName ('remove ' );
798
827
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_500 );
@@ -846,6 +875,8 @@ public function testRemoveActionThrowsRepositoryExceptionIfUnableToFetchReposito
846
875
]
847
876
);
848
877
878
+ $ this ->assertMatchedRouteName ('zf-module/remove ' );
879
+
849
880
$ this ->assertControllerName (Controller \ModuleController::class);
850
881
$ this ->assertActionName ('remove ' );
851
882
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_500 );
@@ -907,6 +938,8 @@ public function testRemoveActionThrowsRepositoryExceptionWhenRepositoryHasInsuff
907
938
]
908
939
);
909
940
941
+ $ this ->assertMatchedRouteName ('zf-module/remove ' );
942
+
910
943
$ this ->assertControllerName (Controller \ModuleController::class);
911
944
$ this ->assertActionName ('remove ' );
912
945
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_500 );
@@ -982,6 +1015,8 @@ public function testRemoveActionThrowsRepositoryExceptionWhenRepositoryNotPrevio
982
1015
]
983
1016
);
984
1017
1018
+ $ this ->assertMatchedRouteName ('zf-module/remove ' );
1019
+
985
1020
$ this ->assertControllerName (Controller \ModuleController::class);
986
1021
$ this ->assertActionName ('remove ' );
987
1022
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_500 );
@@ -1067,6 +1102,8 @@ public function testRemoveActionDeletesModuleIfPermissionsAreSufficientAndItHasB
1067
1102
]
1068
1103
);
1069
1104
1105
+ $ this ->assertMatchedRouteName ('zf-module/remove ' );
1106
+
1070
1107
$ this ->assertControllerName (Controller \ModuleController::class);
1071
1108
$ this ->assertActionName ('remove ' );
1072
1109
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_302 );
@@ -1107,6 +1144,8 @@ public function testViewActionSetsHttp404ResponseCodeIfModuleNotFound()
1107
1144
1108
1145
$ this ->dispatch ($ url );
1109
1146
1147
+ $ this ->assertMatchedRouteName ('view-module ' );
1148
+
1110
1149
$ this ->assertControllerName (Controller \ModuleController::class);
1111
1150
$ this ->assertActionName ('not-found ' );
1112
1151
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_404 );
@@ -1164,6 +1203,8 @@ public function testViewActionSetsHttp404ResponseCodeIfRepositoryMetaDataNotFoun
1164
1203
1165
1204
$ this ->dispatch ($ url );
1166
1205
1206
+ $ this ->assertMatchedRouteName ('view-module ' );
1207
+
1167
1208
$ this ->assertControllerName (Controller \ModuleController::class);
1168
1209
$ this ->assertActionName ('not-found ' );
1169
1210
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_404 );
@@ -1221,6 +1262,8 @@ public function testViewActionCanBeAccessed()
1221
1262
1222
1263
$ this ->dispatch ($ url );
1223
1264
1265
+ $ this ->assertMatchedRouteName ('view-module ' );
1266
+
1224
1267
$ this ->assertControllerName (Controller \ModuleController::class);
1225
1268
$ this ->assertActionName ('view ' );
1226
1269
}
0 commit comments