From 7cb626e48536e06077ad81951d790232ad3a2eb0 Mon Sep 17 00:00:00 2001 From: chunice Date: Mon, 7 Mar 2016 17:37:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Memcache=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../think/cache/driver/memcacheTest.php | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/thinkphp/library/think/cache/driver/memcacheTest.php diff --git a/tests/thinkphp/library/think/cache/driver/memcacheTest.php b/tests/thinkphp/library/think/cache/driver/memcacheTest.php new file mode 100644 index 00000000..15dfaa5a --- /dev/null +++ b/tests/thinkphp/library/think/cache/driver/memcacheTest.php @@ -0,0 +1,49 @@ + +// +---------------------------------------------------------------------- + +/** + * Memcache缓存驱动测试 + * @author 刘志淳 + */ + +namespace tests\thinkphp\library\think\cache\driver; + +class memcacheTest extends cacheTestCase +{ + private $_cacheInstance = null; + + /** + * 基境缓存类型 + */ + protected function setUp() + { + if (!extension_loaded('memcache')) { + $this->markTestSkipped("Memcache没有安装,已跳过测试!"); + } + \think\Cache::connect(['type' => 'memcache', 'expire' => 2]); + } + + /** + * @return ApcCache + */ + protected function getCacheInstance() + { + if (null === $this->_cacheInstance) { + $this->_cacheInstance = new \think\cache\driver\Memcache(['length' => 3]); + } + return $this->_cacheInstance; + } + + // skip testExpire + public function testExpire() + { + } +}