File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -458,6 +458,24 @@ public function testCustomFiltersLoad()
458458 $ this ->assertSame ('http://hellowworld.com ' , $ request ->url );
459459 }
460460
461+ /**
462+ * @see https://github.com/codeigniter4/CodeIgniter4/issues/4720
463+ */
464+ public function testAllCustomFiltersAreDiscoveredInConstructor ()
465+ {
466+ $ _SERVER ['REQUEST_METHOD ' ] = 'GET ' ;
467+
468+ $ config = [
469+ 'aliases ' => [],
470+ 'globals ' => [],
471+ ];
472+ $ filtersConfig = $ this ->createConfigFromArray (FiltersConfig::class, $ config );
473+ $ filters = $ this ->createFilters ($ filtersConfig );
474+
475+ $ configFilters = $ this ->getPrivateProperty ($ filters , 'config ' );
476+ $ this ->assertContains ('test-customfilter ' , array_keys ($ configFilters ->aliases ));
477+ }
478+
461479 public function testRunThrowsWithInvalidClassType ()
462480 {
463481 $ _SERVER ['REQUEST_METHOD ' ] = 'GET ' ;
You can’t perform that action at this time.
0 commit comments