Skip to content

Commit f2f9638

Browse files
committed
feat: add the before filter for the case.
1 parent 40c098c commit f2f9638

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/system/CodeIgniterTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Config\Modules;
2727
use Config\Routing;
2828
use Tests\Support\Filters\Customfilter;
29+
use Tests\Support\Filters\RedirectFilter;
2930

3031
/**
3132
* @backupGlobals enabled
@@ -941,6 +942,12 @@ public function testRunControllerNotFoundBeforeFilter(): void
941942
$routes = Services::routes();
942943
$routes->setAutoRoute(true);
943944

945+
// Inject the before filter.
946+
$filterConfig = config('Filters');
947+
$filterConfig->aliases['redirectFilter'] = RedirectFilter::class;
948+
$filterConfig->globals['before'] = ['redirectFilter'];
949+
Services::filters($filterConfig);
950+
944951
$this->expectException(PageNotFoundException::class);
945952

946953
$this->codeigniter->run($routes);

0 commit comments

Comments
 (0)