Exemplo n.º 1
0
 public function testNonStringKey()
 {
     $this->expectException(InvalidArgumentException::class);
     Utility::validateKey(new \stdClass());
 }
Exemplo n.º 2
0
 /**
  * Removes multiple items from the pool.
  *
  * @param array $keys
  *                    An array of keys that should be removed from the pool.
  *
  * @throws InvalidArgumentException
  *                                  If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException
  *                                  MUST be thrown.
  *
  * @return bool
  *              True if the items were successfully removed. False if there was an error.
  */
 public function deleteItems(array $keys)
 {
     foreach ($keys as $key) {
         Utility::validateKey($key);
     }
     foreach ($keys as $key) {
         $this->_cache->delete($key);
     }
     // TODO: Spec is somewhat not clear. What to return if one item could not be deleted?
     return true;
 }