Browse Source

added simple unit test for CacheSession

tags/2.0.0-alpha
Carsten Brandt 11 years ago
parent
commit
bd2404f1c6
  1. 28
      tests/unit/framework/web/CacheSessionTest.php

28
tests/unit/framework/web/CacheSessionTest.php

@ -0,0 +1,28 @@
<?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'));
}
}
Loading…
Cancel
Save