public function deleteItems(array $keys) { foreach ($keys as $key) { if (!$this->hasItem($key)) { throw new InvalidArgumentException("No such key in cache: \"{$key}\"."); } $this->deleteItem($key); } }
public function testDeleteInvalidItem() { $this->setExpectedException(InvalidArgumentException::class); $this->cache->deleteItems(['foo', 'bar']); }