From bb0f7a0f25545b067d796d2eeeecb19901abdd5f Mon Sep 17 00:00:00 2001 From: carl <> Date: Thu, 26 Jul 2007 16:01:17 +0000 Subject: #623 - MemCache to support multiple servers --- tests/unit/Caching/TMemCacheTest.php | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 tests/unit/Caching/TMemCacheTest.php (limited to 'tests/unit/Caching/TMemCacheTest.php') diff --git a/tests/unit/Caching/TMemCacheTest.php b/tests/unit/Caching/TMemCacheTest.php new file mode 100644 index 00000000..bafae6cf --- /dev/null +++ b/tests/unit/Caching/TMemCacheTest.php @@ -0,0 +1,72 @@ +app = new TApplication($basePath); + self::$cache = new TMemCache(); + self::$cache->init(null); + } + } + + protected function tearDown() { + $this->app = null; + $this->cache = null; + } + + public function testInit() { + throw new PHPUnit_Framework_IncompleteTestError(); + } + + public function testPrimaryCache() { + self::$cache->PrimaryCache = true; + self::assertEquals(true, self::$cache->PrimaryCache); + self::$cache->PrimaryCache = false; + self::assertEquals(false, self::$cache->PrimaryCache); + } + + public function testKeyPrefix() { + self::$cache->KeyPrefix = 'prefix'; + self::assertEquals('prefix', self::$cache->KeyPrefix); + } + + public function testSetAndGet() { + self::$cache->set('key', 'value'); + self::assertEquals('value', self::$cache->get('key')); + } + + public function testAdd() { + self::$cache->add('anotherkey', 'value'); + self::assertEquals('value', self::$cache->get('anotherkey')); + } + + public function testDelete() { + self::$cache->delete('key'); + self::assertEquals(false, self::$cache->get('key')); + } + + public function testFlush() { + $this->testSetAndGet(); + self::assertEquals(true, self::$cache->flush()); + } + +} + +?> -- cgit v1.2.3