From bd2404f1c6f53356e959a14455e7f4f9f3e96dc2 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 18 Sep 2013 22:46:43 +0200 Subject: [PATCH] added simple unit test for CacheSession --- tests/unit/framework/web/CacheSessionTest.php | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/unit/framework/web/CacheSessionTest.php diff --git a/tests/unit/framework/web/CacheSessionTest.php b/tests/unit/framework/web/CacheSessionTest.php new file mode 100644 index 0000000..c80fa1c --- /dev/null +++ b/tests/unit/framework/web/CacheSessionTest.php @@ -0,0 +1,28 @@ +mockApplication(); + Yii::$app->setComponent('cache', new FileCache()); + } + + public function testCreate() + { + $session = new CacheSession(); + + $session->writeSession('test', 'sessionData'); + $this->assertEquals('sessionData', $session->readSession('test')); + } +}