mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-07 07:47:24 +01:00
29 lines
502 B
PHP
29 lines
502 B
PHP
<?php
|
|
|
|
namespace yiiunit\framework\web;
|
|
|
|
use Yii;
|
|
use yii\caching\FileCache;
|
|
use yii\web\CacheSession;
|
|
|
|
/**
|
|
* @group web
|
|
*/
|
|
class CacheSessionTest extends \yiiunit\TestCase
|
|
{
|
|
protected function setUp()
|
|
{
|
|
parent::setUp();
|
|
$this->mockApplication();
|
|
Yii::$app->setComponent('cache', new FileCache());
|
|
}
|
|
|
|
public function testCreate()
|
|
{
|
|
$session = new CacheSession();
|
|
|
|
$session->writeSession('test', 'sessionData');
|
|
$this->assertEquals('sessionData', $session->readSession('test'));
|
|
}
|
|
}
|