public function testGet() { $memcache = $this->getMemcache(); $item = new MemcacheItem(); $item->setKey('foo'); $item->setValue(23); $memcache->saveItem($item); $item = $memcache->getItem('foo'); $this->assertInstanceOf(CacheItem::class, $item); $this->assertTrue($item->isHit()); $this->assertEquals(23, $item->getValue()); }
/** * @param string $key * * @return MemcacheItem */ public function getItem(string $key) { $item = new MemcacheItem(); $item->setStorage($this); $item->setKey($key); return $item; }