Commit bd2404f1 by Carsten Brandt

added simple unit test for CacheSession

parent b8ffee65
<?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'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment