// +---------------------------------------------------------------------- /** * 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() { } }