-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedisHandlerTest.php
More file actions
executable file
·41 lines (31 loc) · 1.07 KB
/
RedisHandlerTest.php
File metadata and controls
executable file
·41 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Koded\Session\Handler;
use Koded\Session\{PhpSession, SessionTestCaseTrait};
use Koded\Stdlib\Config;
use PHPUnit\Framework\TestCase;
use function Koded\Session\session_register_custom_handler;
class RedisHandlerTest extends TestCase
{
use SessionTestCaseTrait;
protected function setUp()
{
if (false === extension_loaded('redis')) {
$this->markTestSkipped('Redis extension is not loaded');
}
$config = (new Config)->import([
'session' => [
'name' => 'test',
'save_handler' => 'redis',
'expire_at_browser_close' => false,
'use_cookies' => false,
'cache_limiter' => '',
'gc_maxlifetime' => 60,
'host' => 'redis'
]
]);
$settings = session_register_custom_handler($config);
session_start($settings->sessionParameters());
$this->SUT = new PhpSession;
$_SESSION['foo'] = 'bar';
}
}