public function MemcachedCacheTest::setUp

File

drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php, line 11

Class

MemcachedCacheTest

Namespace

Doctrine\Tests\Common\Cache

Code

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