Skip to content

Commit 7091a47

Browse files
committed
make test executable fo lower CI versions
1 parent 56212b0 commit 7091a47

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/Authentication/Authenticators/SessionAuthenticatorTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace Tests\Authentication\Authenticators;
1515

16+
use CodeIgniter\CodeIgniter;
1617
use CodeIgniter\Config\Factories;
1718
use CodeIgniter\Shield\Authentication\Authentication;
1819
use CodeIgniter\Shield\Authentication\AuthenticationException;
@@ -105,7 +106,11 @@ public function testLoggedInWithRememberCookie(): void
105106
// Set Cookie value for remember-me.
106107
$token = $selector . ':' . $validator;
107108
$cookieName = $cookiePrefix . setting('Auth.sessionConfig')['rememberCookieName'];
108-
service('superglobals')->setCookie($cookieName, $token);
109+
if (version_compare(CodeIgniter::CI_VERSION, '4.7.0', '<')) {
110+
$_COOKIE[$cookieName] = $token;
111+
} else {
112+
service('superglobals')->setCookie($cookieName, $token);
113+
}
109114

110115
$this->assertTrue($this->auth->loggedIn());
111116

0 commit comments

Comments
 (0)