Skip to content

Commit 739dd82

Browse files
committed
fix tests
1 parent 6c03082 commit 739dd82

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

tests/system/Honeypot/HoneypotTest.php

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use CodeIgniter\Superglobals;
2525
use CodeIgniter\Test\CIUnitTestCase;
2626
use Config\App;
27+
use Config\Filters as FiltersConfig;
2728
use Config\Honeypot as HoneypotConfig;
2829
use PHPUnit\Framework\Attributes\BackupGlobals;
2930
use 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>');

utils/phpstan-baseline/argument.type.neon

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 84 errors
1+
# total 82 errors
22

33
parameters:
44
ignoreErrors:
@@ -162,11 +162,6 @@ parameters:
162162
count: 1
163163
path: ../../tests/system/HomeTest.php
164164

165-
-
166-
message: '#^Parameter \#1 \$config of class CodeIgniter\\Filters\\Filters constructor expects Config\\Filters, object\{aliases\: array\<string, string\>, globals\: array\<string, list\<string\>\>\}&stdClass given\.$#'
167-
count: 2
168-
path: ../../tests/system/Honeypot/HoneypotTest.php
169-
170165
-
171166
message: '#^Parameter \#1 \$data of method CodeIgniter\\HTTP\\Message\:\:setBody\(\) expects string, null given\.$#'
172167
count: 1

utils/phpstan-baseline/loader.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 2062 errors
1+
# total 2060 errors
22

33
includes:
44
- argument.type.neon

0 commit comments

Comments
 (0)