From f770b785736f5fe6035cf7956c6589b0f37a7d02 Mon Sep 17 00:00:00 2001 From: 7IN0SAN9 Date: Wed, 27 Jan 2016 21:02:30 +0800 Subject: [PATCH] =?UTF-8?q?Memcached=20=E7=BC=93=E5=AD=98=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../think/cache/driver/memcachedTest.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/thinkphp/library/think/cache/driver/memcachedTest.php diff --git a/tests/thinkphp/library/think/cache/driver/memcachedTest.php b/tests/thinkphp/library/think/cache/driver/memcachedTest.php new file mode 100644 index 00000000..95328482 --- /dev/null +++ b/tests/thinkphp/library/think/cache/driver/memcachedTest.php @@ -0,0 +1,50 @@ + +// +---------------------------------------------------------------------- + +/** + * Memcached缓存驱动测试 + * @author 7IN0SAN9 + */ + +namespace tests\thinkphp\library\think\cache\driver; + +class memcachedTest extends cacheTestCase +{ + private $_cacheInstance = null; + /** + * 基境缓存类型 + */ + protected function setUp() + { + \think\Cache::connect(array('type' => 'memcached', 'expire' => 2)); + } + /** + * @return ApcCache + */ + protected function getCacheInstance() + { + if (!extension_loaded("memcached")) { + $this->markTestSkipped("Memcached没有安装,已跳过测试!"); + } + if (null === $this->_cacheInstance) { + $this->_cacheInstance = new \think\cache\driver\Memcached(); + } + return $this->_cacheInstance; + } + /** + * 缓存过期测试《提出来测试,因为目前看通不过缓存过期测试,所以还需研究》 + * @return mixed + * @access public + */ + public function testExpire() + { + } +}