function testStore() { $file = __DIR__ . "/file.php"; $cache = new Cache($file); $cache->set("a", "b"); unset($cache); $this->assertEquals(true, is_file($file)); $content = (include $file); $this->assertArrayHasKey("a", $content); unlink($file); }
/** * This method can be used to give a significant performance boost to your * application by pre-generating and caching the routing table. Note that * this caching is NOT performed automatically and that the $api->cacheFile * property needs to be set to a writable path for this to succeed. * * @see cacheFile * @return void */ public function createCache() { $cache = new Cache($this->cacheFile); $router = new Router($cache, new UrlTools()); $table = $router->getRoutingTable($this->resources); $cache->set("router", $table); }