mockApplication(); Yii::$app->set('cache', new FileCache()); } public function testCacheSession() { $session = new CacheSession(); $session->writeSession('test', 'sessionData'); $this->assertEquals('sessionData', $session->readSession('test')); $session->destroySession('test'); $this->assertEquals('', $session->readSession('test')); } public function testInvalidCache() { $this->setExpectedException('\Exception'); new CacheSession(['cache' => 'invalid']); } }