Files
framework/tests/thinkphp/library/think/cache/driver/apcTest.php
2016-01-20 11:14:19 +08:00

53 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
/**
* Apc缓存驱动测试
* @author mahuan <mahuan@d1web.top>
*/
namespace tests\thinkphp\library\think\cache\driver;
class apcTest extends cacheTestCase
{
private $_cacheInstance = null;
/**
* 基境缓存类型
*/
protected function setUp()
{
\think\Cache::connect(array('type' => 'apc', 'expire' => 2));
}
/**
* @return ApcCache
*/
protected function getCacheInstance()
{
if (!extension_loaded("apc")) {
$this->markTestSkipped("APC没有安装已跳过测试");
} elseif ('cli' === PHP_SAPI && !ini_get('apc.enable_cli')) {
$this->markTestSkipped("APC模块没有开启已跳过测试");
}
if (null === $this->_cacheInstance) {
$this->_cacheInstance = new \think\cache\driver\Apc();
}
return $this->_cacheInstance;
}
/**
* 缓存过期测试《提出来测试,因为目前看通不过缓存过期测试,所以还需研究》
* @return mixed
* @access public
*/
public function testExpire()
{
}
}