You are here

public function MemcachedCacheTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php \Doctrine\Tests\Common\Cache\MemcachedCacheTest::setUp()

File

vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php, line 12

Class

MemcachedCacheTest

Namespace

Doctrine\Tests\Common\Cache

Code

public function setUp() {
  if (!extension_loaded('memcached')) {
    $this
      ->markTestSkipped('The ' . __CLASS__ . ' requires the use of memcached');
  }
  $this->memcached = new Memcached();
  $this->memcached
    ->setOption(Memcached::OPT_COMPRESSION, false);
  $this->memcached
    ->addServer('127.0.0.1', 11211);
  if (@fsockopen('127.0.0.1', 11211) === false) {
    unset($this->memcached);
    $this
      ->markTestSkipped('The ' . __CLASS__ . ' cannot connect to memcache');
  }
}