-
-
Notifications
You must be signed in to change notification settings - Fork 2k
/
ReadCest.php
49 lines (41 loc) · 1.19 KB
/
ReadCest.php
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
42
43
44
45
46
47
48
49
<?php
declare(strict_types=1);
/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <team@phalconphp.com>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
namespace Phalcon\Test\Integration\Session\Adapter\Redis;
use IntegrationTester;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Fixtures\Traits\SessionTrait;
use function uniqid;
class ReadCest
{
use DiTrait;
use SessionTrait;
public function _before(IntegrationTester $I)
{
$this->newFactoryDefault();
}
/**
* Tests Phalcon\Session\Adapter\Redis :: write()
*
* @author Phalcon Team <team@phalconphp.com>
* @since 2018-11-13
*/
public function sessionAdapterRedisRead(IntegrationTester $I)
{
$I->wantToTest('Session\Adapter\Redis - write()');
$adapter = $this->getSessionRedis();
$value = uniqid();
$I->haveInRedis('string', 'sess-reds-test1', $value);
$expected = $value;
$actual = $adapter->read('test1');
$I->assertEquals($expected, $actual);
$I->sendCommandToRedis('del', 'sess-reds-test1');
}
}