Ejemplo 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 (!JCacheStorageApc::isSupported() || $this->isBlacklisted('apc')) {
         $this->markTestSkipped('The APC cache handler is not supported on this system.');
     }
     parent::setUp();
     $this->handler = new JCacheStorageApc();
     // Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds)
     $this->handler->_lifetime = 2;
 }
Ejemplo n.º 2
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 (!JCacheStorageFile::isSupported() || $this->isBlacklisted('file')) {
         $this->markTestSkipped('The file cache handler is not supported on this system.');
     }
     parent::setUp();
     $this->handler = new JCacheStorageFile(array('cachebase' => JPATH_CACHE));
     // 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 (!JCacheStorageCachelite::isSupported()) {
         $this->markTestSkipped('The Cache_Lite cache handler is not supported on this system.');
     }
     parent::setUp();
     $this->handler = new JCacheStorageCachelite(array('caching' => true, 'cachebase' => JPATH_TESTS . '/tmp'));
     // 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;
 }
 /**
  * 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 (!JCacheStorageMemcache::isSupported()) {
         $this->markTestSkipped('The Memcache cache handler is not supported on this system.');
     }
     parent::setUp();
     try {
         $this->handler = new JCacheStorageMemcache();
     } catch (JCacheExceptionConnecting $e) {
         $this->markTestSkipped('Failed to connect to Memcache');
     }
     // Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds)
     $this->handler->_lifetime = 2;
 }
Ejemplo n.º 6
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;
 }