You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
502 B
29 lines
502 B
11 years ago
|
<?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'));
|
||
|
}
|
||
|
}
|