From 55c4ac1bfe565f1ca7f537fdd8b7a201be28e581 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 10 Nov 2005 12:47:19 +0000 Subject: Initial import of prado framework --- tests/UnitTests/framework/Data/utSqliteCache.php | 59 ++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tests/UnitTests/framework/Data/utSqliteCache.php (limited to 'tests/UnitTests/framework/Data/utSqliteCache.php') diff --git a/tests/UnitTests/framework/Data/utSqliteCache.php b/tests/UnitTests/framework/Data/utSqliteCache.php new file mode 100644 index 00000000..726a5c08 --- /dev/null +++ b/tests/UnitTests/framework/Data/utSqliteCache.php @@ -0,0 +1,59 @@ +dbFile='utSqliteCache.test'; + } + + public function tearDown() + { + $file=Prado::getPathOfNamespace('utSqliteCache.test',TSqliteCache::DB_FILE_EXT); + if(is_file($file)) + unlink($file); + else + $this->fail("Unable to clean up db file: '".$file."'."); + } + + public function testInit() + { + $cache=new TSqliteCache; + + $this->assertTrue($cache->getDbFile()===null); + $cache->setDbFile($this->dbFile); + $this->assertTrue($cache->getDbFile()===$this->dbFile); + + $cache->init(null,null); + try + { + $cache->setDbFile('newfile.db'); + $this->fail('exception not raised when setting DbFile after init'); + } + catch(TInvalidOperationException $e) + { + $this->pass(); + } + } + + public function testBasicOperations() + { + $cache=new TSqliteCache; + $cache->setDbFile($this->dbFile); + $cache->init(null,null); + $this->setCache($cache); + $this->basicOperations(); + $this->setCache(null); + } +} + +?> \ No newline at end of file -- cgit v1.2.3