diff --git a/src/Storage/Adapter/MemcachedOptions.php b/src/Storage/Adapter/MemcachedOptions.php index c5aee7132..ceff8c436 100644 --- a/src/Storage/Adapter/MemcachedOptions.php +++ b/src/Storage/Adapter/MemcachedOptions.php @@ -200,7 +200,7 @@ public function getPersistentId() public function setPersistentId($persistentId) { $this->triggerOptionEvent('persistent_id', $persistentId); - $this->getResourceManager()->setPersistentId($this->getPersistentId(), $persistentId); + $this->getResourceManager()->setPersistentId($this->getResourceId(), $persistentId); return $this; } diff --git a/test/Storage/Adapter/MemcachedTest.php b/test/Storage/Adapter/MemcachedTest.php index af5bb388e..1c1d47383 100644 --- a/test/Storage/Adapter/MemcachedTest.php +++ b/test/Storage/Adapter/MemcachedTest.php @@ -180,6 +180,17 @@ public function testLibOptionSet() )); } + public function testOptionPersistentId() + { + $options = new Cache\Storage\Adapter\MemcachedOptions(); + $resourceId = $options->getResourceId(); + $resourceManager = $options->getResourceManager(); + $options->setPersistentId('testPersistentId'); + + $this->assertSame('testPersistentId', $resourceManager->getPersistentId($resourceId)); + $this->assertSame('testPersistentId', $options->getPersistentId()); + } + public function tearDown() { if ($this->_storage) {