Exemplo n.º 1
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  */
 protected function setUp()
 {
     if (!JCacheStorageRedis::isSupported() || $this->isBlacklisted('redis')) {
         $this->markTestSkipped('The Redis cache handler is not supported on this system.');
     }
     parent::setUp();
     $this->handler = new JCacheStorageRedis();
     // Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds)
     $this->handler->_lifetime = 2;
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  */
 protected function setUp()
 {
     if (!JCacheStorageRedis::isSupported()) {
         $this->markTestSkipped('The Redis cache handler is not supported on this system.');
     }
     parent::setUp();
     $this->handler = new JCacheStorageRedis();
     // This adapter doesn't throw an Exception on a connection failure so we'll have to use Reflection to get into the class to check it
     if (!TestReflection::getValue($this->handler, '_redis') instanceof Redis) {
         $this->markTestSkipped('Failed to connect to Redis');
     }
     // Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds)
     $this->handler->_lifetime = 2;
 }
Exemplo n.º 3
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  */
 protected function setUp()
 {
     if (!JCacheStorageRedis::isSupported()) {
         $this->markTestSkipped('The Redis cache handler is not supported on this system.');
     }
     parent::setUp();
     // Mock the returns on JApplicationCms::get() to use the default values
     JFactory::$application->expects($this->any())->method('get')->willReturnArgument(1);
     $this->handler = new JCacheStorageRedis();
     // This adapter doesn't throw an Exception on a connection failure so we'll have to use Reflection to get into the class to check it
     if (!TestReflection::getValue($this->handler, '_redis') instanceof Redis) {
         $this->markTestSkipped('Failed to connect to Redis');
     }
     // Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds)
     $this->handler->_lifetime = 2;
 }
 /**
  * Check availability of all cache handlers
  *
  * @return void
  */
 private function checkAvailability()
 {
     $this->available = array('apc' => JCacheStorageApc::isSupported(), 'apcu' => JCacheStorageApcu::isSupported(), 'cachelite' => JCacheStorageCachelite::isSupported(), 'file' => true, 'memcache' => JCacheStorageMemcache::isSupported(), 'memcached' => JCacheStorageMemcached::isSupported(), 'redis' => JCacheStorageRedis::isSupported(), 'wincache' => JCacheStorageWincache::isSupported(), 'xcache' => JCacheStorageXcache::isSupported());
 }
Exemplo n.º 5
0
 /**
  * Testing isSupported().
  *
  * @return  void
  */
 public function testIsSupported()
 {
     $this->assertEquals($this->extensionAvailable, $this->object->isSupported(), 'Claims APC is not loaded.');
 }