summaryrefslogtreecommitdiff
path: root/tests/UnitTests/framework/Data/utMemCache.php
diff options
context:
space:
mode:
authorxue <>2006-07-07 14:54:15 +0000
committerxue <>2006-07-07 14:54:15 +0000
commit61bb16ee2e5f0a66234e1575242169a10fde47b5 (patch)
tree3ee24dcc36ceae2c213130df1ea3d5c9fc110a27 /tests/UnitTests/framework/Data/utMemCache.php
parent7b84938b1b5964f2274d66e28ba17435924ffe35 (diff)
Merge from 3.0 branch till 1253.
Diffstat (limited to 'tests/UnitTests/framework/Data/utMemCache.php')
-rw-r--r--tests/UnitTests/framework/Data/utMemCache.php66
1 files changed, 0 insertions, 66 deletions
diff --git a/tests/UnitTests/framework/Data/utMemCache.php b/tests/UnitTests/framework/Data/utMemCache.php
deleted file mode 100644
index cbe9bdad..00000000
--- a/tests/UnitTests/framework/Data/utMemCache.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-require_once(dirname(__FILE__).'/../common.php');
-require_once(dirname(__FILE__).'/CacheTestCase.php');
-Prado::using('System.Caching.TMemCache');
-
-class utMemCache extends UnitTestCase
-{
- private $_prefix='';
- private $_server='localhost';
- private $_port=11211;
-
- public function testInit()
- {
- if(!extension_loaded('memcache'))
- {
- $this->fail('TMemCache is not tested. PHP extension "memcache" is required by TMemCache.');
- return;
- }
- $cache=new TMemCache;
-
- $this->assertTrue($cache->getHost()==='localhost');
- $cache->setHost('localhost2');
- $this->assertTrue($cache->getHost()==='localhost2');
-
- $this->assertTrue($cache->getPort()===11211);
- $cache->setPort(1000);
- $this->assertTrue($cache->getPort()===1000);
-
- $cache->init(null,null);
- try
- {
- $cache->setHost('newhost');
- $this->fail('exception not raised when setting Server after init');
- }
- catch(TInvalidOperationException $e)
- {
- $this->pass();
- }
- try
- {
- $cache->setPort(10000);
- $this->fail('exception not raised when setting Port after init');
- }
- catch(TInvalidOperationException $e)
- {
- $this->pass();
- }
- }
-
- public function testBasicOperations()
- {
- if(!extension_loaded('memcache'))
- {
- $this->fail('TMemCache is not tested. PHP extension "memcache" is required by TMemCache.');
- return;
- }
- $cache=new TMemCache;
- $cache->init(null,null);
- $this->setCache($cache);
- $this->basicOperations();
- $this->setCache(null);
- }
-}
-
-?> \ No newline at end of file