Welcome Guest, Not a member yet? Register   Sign In
No sessions in testing environment?
#1

Hi,

The code below (system\Session\Session.php) appears to block sessions when your environment is set to testing  Confused

Code:
/**
* Starts the session.
* Extracted for testing reasons.
*/
protected function startSession()
{
  if (ENVIRONMENT === 'testing')
  {
    $_SESSION = [];
    return;
  }

  session_start(); // @codeCoverageIgnore
}
Reply
#2

That's by design - https://codeigniter.com/user_guide/gener...ments.html

Quote:The environment testing is the special one for PHPUnit testing. It has special conditions built into the framework at various places to assist with that. You can’t use it for your development.
Reply
#3

(05-18-2021, 07:17 AM)craig Wrote: That's by design - https://codeigniter.com/user_guide/gener...ments.html

Quote:The environment testing is the special one for PHPUnit testing. It has special conditions built into the framework at various places to assist with that. You can’t use it for your development.

Thanks for the info & link  Big Grin

I'll set up a "test" environment  Wink
Reply
#4
Big Grin 

Big Grin Happy to help!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB