Archived: Use PHPUnit process isolation instead.
Allows you to to write tests for code that uses the Kirby 3 session.
use Kirby\Cms\App;
use Mzur\Kirby\DefuseSession\Defuse;
public function testSession()
{
Defuse::defuse();
$session = App::instance()->session();
$session->set('testKey', 'testValue');
$this->assertEquals('testValue', $session->get('testKey'));
}
composer require --dev mzur/kirby-defuse-session:@beta
Feel free to send a pull request!
Please use the GitHub issue tracker.