/** @test */ public function it_caches_the_given_key() { $post = $this->makePost(); $cache = new \Illuminate\Cache\Repository(new \Illuminate\Cache\ArrayStore()); $cache = new Katching($cache); $cache->put($post, '<div>view fragment</div>'); $this->assertTrue($cache->has($post->getCacheKey())); $this->assertTrue($cache->has($post)); }
/** * Handle the @cache setup. * * @param mixed $model * @param string|null $key */ public function setup($model, $key = null) { ob_start(); $this->keys[] = $key = $this->normalizeKey($model, $key); return $this->cache->has($key); }