Pinq\Caching\CacheProvider::setDevelopmentMode PHP Method

setDevelopmentMode() public static method

If set to true, the cache will be cleared when needed.
public static setDevelopmentMode ( boolean $isDevelopmentMode ) : void
$isDevelopmentMode boolean
return void
    public static function setDevelopmentMode($isDevelopmentMode)
    {
        self::$isDevelopmentMode = $isDevelopmentMode;
    }

Usage Example

Beispiel #1
0
 public function testThatDevelopmentModeWillClearTheCacheOnce()
 {
     $functionCacheMock = $this->getMock('Pinq\\Caching\\ICacheAdapter');
     $functionCacheMock->expects($this->once())->method('clear');
     Caching\CacheProvider::setCustomCache($functionCacheMock);
     Caching\CacheProvider::setDevelopmentMode(true);
     //Should clear
     Caching\CacheProvider::getCache();
     //Should not clear again
     Caching\CacheProvider::getCache();
 }