File tree Expand file tree Collapse file tree
tests/Authentication/Authenticators Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414namespace Tests \Authentication \Authenticators ;
1515
16+ use CodeIgniter \CodeIgniter ;
1617use CodeIgniter \Config \Factories ;
1718use CodeIgniter \Shield \Authentication \Authentication ;
1819use 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
You can’t perform that action at this time.
0 commit comments