/** * test using authentication without memcached installed with SASL support * throw an exception * * @expectedException \InvalidArgumentException * @expectedExceptionMessage Memcached extension is not build with SASL support * @return void */ public function testSaslAuthException() { $MemcachedEngine = new TestMemcachedEngine(); $config = ['engine' => 'Memcached', 'servers' => ['127.0.0.1:11211'], 'persistent' => false, 'username' => 'test', 'password' => 'password']; $MemcachedEngine->init($config); }
/** * test that durations greater than 30 days never expire * * @return void */ public function testLongDurationEqualToZero() { $memcached = new TestMemcachedEngine(); $memcached->init(['prefix' => 'Foo_', 'compress' => false, 'duration' => 50 * DAY]); $mock = $this->getMock('Memcached'); $memcached->setMemcached($mock); $mock->expects($this->once())->method('set')->with('Foo_key', 'value', 0); $value = 'value'; $memcached->write('key', $value); }