Exemplo n.º 1
0
 /**
  * Setup the tests.
  *
  * @return  void
  *
  * @since   1.0
  */
 public function setUp()
 {
     if (!class_exists('Memcached')) {
         $this->markTestSkipped('The Memcached class does not exist.');
         return;
     }
     $options = $this->cacheOptions;
     if (!$options) {
         $options = array();
     }
     if (!is_array($options)) {
         $options = array($options);
     }
     if (!isset($options['memcache.servers'])) {
         $server = new \StdClass();
         $server->host = 'localhost';
         $server->port = '11211';
         $options['memcache.servers'] = array($server);
     }
     $this->cacheOptions = $options;
     $this->cacheClass = 'Joomla\\Cache\\Memcached';
     parent::setUp();
 }
Exemplo n.º 2
0
 /**
  * Setup the tests.
  *
  * @return  void
  *
  * @since   1.0
  */
 protected function setUp()
 {
     $this->cacheClass = 'Joomla\\Cache\\Apc';
     try {
         parent::setUp();
         $this->instance->set('foo', 'bar');
     } catch (\Exception $e) {
         $this->markTestSkipped();
     }
 }