WinCacheTest.php 613 Bytes
Newer Older
1 2
<?php
namespace yiiunit\framework\caching;
Alexander Makarov committed
3
use yii\caching\WinCache;
4 5 6 7

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

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

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

resurtm committed
25
		if ($this->_cacheInstance === null) {
26 27 28 29
			$this->_cacheInstance = new WinCache();
		}
		return $this->_cacheInstance;
	}
Zander Baldwin committed
30
}