$fetched =
[];
$adapter->
get('myKey',
function D
$item) use (&
$fetched) { $fetched[] =
$item;
});
$this->
assertCount(1,
$fetched);
$item =
$fetched[0
];
$this->
assertFalse($item->
isHit());
$this->
assertNull($item->
get(), "Item's value must be null when isHit is false."
);
$this->
assertSame('myKey',
$item->
getKey());
} public function testHasItem() { $this->
assertFalse($this->
createCachePool()->
hasItem('key'
));
} public function testGetItems() { $adapter =
$this->
createCachePool();
$keys =
['foo', 'bar', 'baz', 'biz'
];
/** @var CacheItemInterface[] $items */
$items =
$adapter->
getItems($keys);
$count = 0;