WinCacheTest.php 651 Bytes
Newer Older
1 2
<?php
namespace yiiunit\framework\caching;
Alexander Makarov committed
3

Alexander Makarov committed
4
use yii\caching\WinCache;
5 6 7

/**
 * Class for testing wincache backend
8 9
 * @group wincache
 * @group caching
10
 */
Alexander Makarov committed
11
class WinCacheTest extends CacheTestCase
12 13 14 15 16 17 18 19
{
	private $_cacheInstance = null;

	/**
	 * @return WinCache
	 */
	protected function getCacheInstance()
	{
resurtm committed
20
		if (!extension_loaded('wincache')) {
21 22 23
			$this->markTestSkipped("Wincache not installed. Skipping.");
		}

resurtm committed
24
		if (!ini_get('wincache.ucenabled')) {
25 26 27
			$this->markTestSkipped("Wincache user cache disabled. Skipping.");
		}

resurtm committed
28
		if ($this->_cacheInstance === null) {
29 30 31 32
			$this->_cacheInstance = new WinCache();
		}
		return $this->_cacheInstance;
	}
Zander Baldwin committed
33
}