Skip to content

Commit b870721

Browse files
committed
fix tests
1 parent 7e35a0c commit b870721

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

phpstan-baseline.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,6 @@
127127
'count' => 4,
128128
'path' => __DIR__ . '/src/Authentication/Passwords/NothingPersonalValidator.php',
129129
];
130-
$ignoreErrors[] = [
131-
'rawMessage' => 'PHPDoc tag @var with type string is not subtype of type uppercase-string.',
132-
'identifier' => 'varTag.type',
133-
'count' => 1,
134-
'path' => __DIR__ . '/src/Authentication/Passwords/PwnedValidator.php',
135-
];
136130
$ignoreErrors[] = [
137131
'rawMessage' => 'Only booleans are allowed in &&, CodeIgniter\\Shield\\Entities\\User|null given on the right side.',
138132
'identifier' => 'booleanAnd.rightNotBoolean',
@@ -427,6 +421,12 @@
427421
'count' => 8,
428422
'path' => __DIR__ . '/tests/Authentication/Authenticators/SessionAuthenticatorTest.php',
429423
];
424+
$ignoreErrors[] = [
425+
'rawMessage' => 'Call to method setCookie() of internal class CodeIgniter\\Superglobals from outside its root namespace CodeIgniter.',
426+
'identifier' => 'method.internalClass',
427+
'count' => 1,
428+
'path' => __DIR__ . '/tests/Authentication/Authenticators/SessionAuthenticatorTest.php',
429+
];
430430
$ignoreErrors[] = [
431431
'rawMessage' => 'Parameter #1 $headers of method Tests\\Authentication\\Filters\\AbstractFilterTestCase::withHeaders() expects array<string, CodeIgniter\\HTTP\\Header|list<CodeIgniter\\HTTP\\Header>>, array{Authorization: non-falsy-string} given.',
432432
'identifier' => 'argument.type',

tests/Authentication/Authenticators/SessionAuthenticatorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ public function testLoggedInWithRememberCookie(): void
103103
$rememberModel->rememberUser($this->user, $selector, hash('sha256', $validator), $expires);
104104

105105
// Set Cookie value for remember-me.
106-
$token = $selector . ':' . $validator;
107-
$cookieName = $cookiePrefix . setting('Auth.sessionConfig')['rememberCookieName'];
108-
$_COOKIE[$cookieName] = $token;
106+
$token = $selector . ':' . $validator;
107+
$cookieName = $cookiePrefix . setting('Auth.sessionConfig')['rememberCookieName'];
108+
service('superglobals')->setCookie($cookieName, $token);
109109

110110
$this->assertTrue($this->auth->loggedIn());
111111

0 commit comments

Comments
 (0)