Ejemplo n.º 1
0
 /**
  * testMsgpackSerializerSetting method
  *
  * @return void
  */
 public function testMsgpackSerializerSetting()
 {
     $this->skipIf(!defined('Memcached::HAVE_MSGPACK') || !Memcached::HAVE_MSGPACK, 'Memcached extension is not compiled with msgpack support');
     $Memcached = new TestMemcachedEngine();
     $config = ['engine' => 'Memcached', 'servers' => ['127.0.0.1:11211'], 'persistent' => false, 'serialize' => 'msgpack'];
     $Memcached->init($config);
     $this->assertEquals(Memcached::SERIALIZER_MSGPACK, $Memcached->getMemcached()->getOption(Memcached::OPT_SERIALIZER));
 }
 /**
  * test using authentication without memcached installed with SASL support
  * throw an exception
  *
  * @return void
  */
 public function testSaslAuthException()
 {
     $Memcached = new TestMemcachedEngine();
     $config = array('engine' => 'Memcached', 'servers' => array('127.0.0.1:11211'), 'persistent' => false, 'login' => 'test', 'password' => 'password');
     $this->skipIf(method_exists($Memcached->getMemcached(), 'setSaslAuthData'), 'Memcached extension is installed with SASL support');
     $this->setExpectedException('Cake\\Error\\Exception', 'Memcached extension is not build with SASL support');
     $Memcached->init($config);
 }