mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-23 02:22:01 +00:00

- update .devcontainer settings: remove auto-formatting for php + set intelephense as default formatter - remove prettier php plugin as it lacks php 8 support - add captain hook action for checking style pre-commit - fix style with ecs on all files except views
40 lines
821 B
PHP
40 lines
821 B
PHP
<?php
|
|
|
|
namespace Tests\Support;
|
|
|
|
use CodeIgniter\Session\Handlers\ArrayHandler;
|
|
use CodeIgniter\Session\SessionInterface;
|
|
use CodeIgniter\Test\CIUnitTestCase;
|
|
use CodeIgniter\Test\Mock\MockSession;
|
|
use Config\Services;
|
|
|
|
/**
|
|
* @phpstan-ignore-next-line
|
|
*/
|
|
class SessionTestCase extends CIUnitTestCase
|
|
{
|
|
/**
|
|
* @var SessionInterface
|
|
*/
|
|
protected $session;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->mockSession();
|
|
}
|
|
|
|
/**
|
|
* Pre-loads the mock session driver into $this->session.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected function mockSession(): void
|
|
{
|
|
$config = config('App');
|
|
$this->session = new MockSession(new ArrayHandler($config, '0.0.0.0'), $config,);
|
|
Services::injectMock('session', $this->session);
|
|
}
|
|
}
|