File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
tests/Authentication/Filters Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 44
55namespace Tests \Authentication \Filters ;
66
7+ use CodeIgniter \Shield \Config \Auth ;
78use CodeIgniter \Shield \Entities \User ;
89use CodeIgniter \Shield \Filters \GroupFilter ;
910use CodeIgniter \Shield \Models \UserModel ;
@@ -69,8 +70,8 @@ public function testFilterIncorrectGroupNoPrevious(): void
6970 ->get ('protected-route ' );
7071
7172 // Should redirect to home page since previous_url is not set
72- $ result ->assertRedirectTo (site_url ( ' / ' ));
73+ $ result ->assertRedirectTo (config (Auth::class)-> afterGroupDeniedRedirect ( ));
7374 // Should have error message
74- $ result ->assertSessionHas ('error ' );
75+ $ result ->assertSessionHas ('error ' , lang ( ' Auth.notEnoughPrivilege ' ) );
7576 }
7677}
Original file line number Diff line number Diff line change 44
55namespace Tests \Authentication \Filters ;
66
7+ use CodeIgniter \Shield \Config \Auth ;
78use CodeIgniter \Shield \Entities \User ;
89use CodeIgniter \Shield \Filters \PermissionFilter ;
910use CodeIgniter \Shield \Models \UserModel ;
@@ -69,8 +70,8 @@ public function testFilterIncorrectGroupNoPrevious(): void
6970 ->get ('protected-route ' );
7071
7172 // Should redirect to home page since previous_url is not set
72- $ result ->assertRedirectTo (site_url ( ' / ' ));
73+ $ result ->assertRedirectTo (config (Auth::class)-> afterPermissionDeniedRedirect ( ));
7374 // Should have error message
74- $ result ->assertSessionHas ('error ' );
75+ $ result ->assertSessionHas ('error ' , lang ( ' Auth.notEnoughPrivilege ' ) );
7576 }
7677}
You can’t perform that action at this time.
0 commit comments