public function testKeysGeneratorFailsWhenNotIterable() { $backend = $this->getMockBuilder('Cachet\\Backend')->getMockForAbstractClass(); $cache = new \Cachet\Cache('cache', $backend); $this->setExpectedException('RuntimeException', "This backend does not support iteration"); $keys = iterator_to_array($cache->keys()); }