public function testGenerateCache() { $this->cacheManager->generateCache(dirname(__DIR__) . '/fixtures/changelog-fixture.md', 'test-changelog.json', 'cached content'); $cacheFile = __DIR__ . '/../../data/cache/fixtures-changelog-fixture-test-changelog.json.cache'; $this->assertFileExists($cacheFile); $this->assertEquals('cached content', file_get_contents($cacheFile)); }
/** * @param string $filepath * @param string $format * @return mixed */ public function getAllVersions($filepath, $format = 'json') { $cacheFile = "all-versions.{$format}"; if (($cache = $this->cacheManager->getCache($filepath, $cacheFile)) !== false) { return $cache; } $this->initializeDriver($format); $this->driver->convert($filepath); $content = $this->driver->getAllVersions(); $this->cacheManager->generateCache($filepath, $cacheFile, $content); return $content; }