diff options
author | ctrlaltca <ctrlaltca@gmail.com> | 2014-08-26 16:59:21 +0200 |
---|---|---|
committer | ctrlaltca <ctrlaltca@gmail.com> | 2014-08-26 16:59:21 +0200 |
commit | 74b31be9515eddfa63005d6760614badfaba9fea (patch) | |
tree | 47c952901dcb5eccd6dd8b7c6ee7e0b6bf176510 /tests/unit/Web/TCacheHttpSessionTest.php | |
parent | 2b11341614ac4a15be697fa8acad07055154ac54 (diff) | |
parent | 0c5026b55cde5c104f10686afd8b441568175d38 (diff) |
Backports for Prado 3.2.4
Diffstat (limited to 'tests/unit/Web/TCacheHttpSessionTest.php')
-rw-r--r-- | tests/unit/Web/TCacheHttpSessionTest.php | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/tests/unit/Web/TCacheHttpSessionTest.php b/tests/unit/Web/TCacheHttpSessionTest.php index 15c2a382..8475cd37 100644 --- a/tests/unit/Web/TCacheHttpSessionTest.php +++ b/tests/unit/Web/TCacheHttpSessionTest.php @@ -11,14 +11,14 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase protected $app = null; protected static $cache = null; protected static $session = null; - + protected function setUp() { if(!extension_loaded('memcache')) { self::markTestSkipped('The memcache extension is not available'); } - else + else { $basePath = dirname(__FILE__).'/app'; $runtimePath = $basePath.'/runtime'; @@ -33,14 +33,14 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase $this->app->setModule('MyCache',self::$cache); } } - + protected function tearDown() { $this->app = null; $this->cache = null; $this->session = null; } - + public function testInit() { $session = new TCacheHttpSession(); @@ -53,7 +53,7 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase { } unset($session); - + $session = new TCacheHttpSession(); try { @@ -66,12 +66,12 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase { } unset($session); - + self::$session = new TCacheHttpSession(); try { self::$session->setCacheModuleID('MyCache'); - self::$session->init(null); + self::$session->init(null); } catch(TConfigurationException $e) { @@ -79,50 +79,49 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase self::markTestSkipped('Cannot continue this test'); } } - + public function testGetCache() { $cache = self::$session->getCache(); $this->assertEquals(true, $cache instanceof TMemCache); } - + public function testCacheModuleID() { $id = 'value'; self::$session->setCacheModuleID($id); self::assertEquals($id, self::$session->getCacheModuleID()); } - + public function testKeyPrefix() { $id = 'value'; self::$session->setKeyPrefix($id); self::assertEquals($id, self::$session->getKeyPrefix()); } - + public function testSetAndGet() { self::$session['key'] = 'value'; self::assertEquals('value', self::$session['key']); } - + public function testAdd() { self::$session->add('anotherkey', 'value'); self::assertEquals('value', self::$session['anotherkey']); } - + public function testRemove() { self::$session->remove('key'); self::assertEquals(false, self::$session['key']); } - + public function testDestroyAndIsStarted() { $this->testSetAndGet(); self::$session->destroy(); self::assertEquals(false, self::$session->getIsStarted()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file |