2020-05-27 18:46:16 +02:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 11:52:11 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-05-06 16:00:48 +02:00
|
|
|
namespace Tests\Session;
|
|
|
|
|
2022-01-04 16:40:27 +01:00
|
|
|
use CodeIgniter\Test\CIUnitTestCase;
|
|
|
|
use Config\Services;
|
2021-05-19 18:35:13 +02:00
|
|
|
|
2022-01-04 16:40:27 +01:00
|
|
|
class ExampleSessionTest extends CIUnitTestCase
|
2020-05-27 18:46:16 +02:00
|
|
|
{
|
2021-05-06 16:00:48 +02:00
|
|
|
public function testSessionSimple(): void
|
2020-08-04 13:25:22 +02:00
|
|
|
{
|
2022-01-04 16:40:27 +01:00
|
|
|
$session = Services::session();
|
2020-05-27 18:46:16 +02:00
|
|
|
|
2022-01-04 16:40:27 +01:00
|
|
|
$session->set('logged_in', 123);
|
|
|
|
$this->assertSame(123, $session->get('logged_in'));
|
2020-08-04 13:25:22 +02:00
|
|
|
}
|
2020-05-27 18:46:16 +02:00
|
|
|
}
|