2424use CodeIgniter \Superglobals ;
2525use CodeIgniter \Test \CIUnitTestCase ;
2626use Config \App ;
27+ use Config \Filters as FiltersConfig ;
2728use Config \Honeypot as HoneypotConfig ;
2829use PHPUnit \Framework \Attributes \BackupGlobals ;
2930use PHPUnit \Framework \Attributes \Group ;
@@ -162,15 +163,11 @@ public function testConfigName(): void
162163
163164 public function testHoneypotFilterBefore (): void
164165 {
165- $ config = [
166- 'aliases ' => ['trap ' => \CodeIgniter \Filters \Honeypot::class],
167- 'globals ' => [
168- 'before ' => ['trap ' ],
169- 'after ' => [],
170- ],
171- ];
172-
173- $ filters = new Filters ((object ) $ config , $ this ->request , $ this ->response );
166+ $ config = new FiltersConfig ();
167+ $ config ->aliases = ['trap ' => \CodeIgniter \Filters \Honeypot::class];
168+ $ config ->globals = ['before ' => ['trap ' ], 'after ' => []];
169+
170+ $ filters = new Filters ($ config , $ this ->request , $ this ->response );
174171 $ uri = 'admin/foo/bar ' ;
175172
176173 $ this ->expectException (HoneypotException::class);
@@ -179,15 +176,11 @@ public function testHoneypotFilterBefore(): void
179176
180177 public function testHoneypotFilterAfter (): void
181178 {
182- $ config = [
183- 'aliases ' => ['trap ' => \CodeIgniter \Filters \Honeypot::class],
184- 'globals ' => [
185- 'before ' => [],
186- 'after ' => ['trap ' ],
187- ],
188- ];
189-
190- $ filters = new Filters ((object ) $ config , $ this ->request , $ this ->response );
179+ $ config = new FiltersConfig ();
180+ $ config ->aliases = ['trap ' => \CodeIgniter \Filters \Honeypot::class];
181+ $ config ->globals = ['before ' => [], 'after ' => ['trap ' ]];
182+
183+ $ filters = new Filters ($ config , $ this ->request , $ this ->response );
191184 $ uri = 'admin/foo/bar ' ;
192185
193186 $ this ->response ->setBody ('<form></form> ' );
0 commit comments