public function testGetCachePath() { $router = $this->getMock('Symfony\\Component\\Routing\\Router', array(), array(), '', false); $extractor = new ExposedRoutesExtractor($router, array(), $this->cacheDir, array()); $this->assertEquals($this->cacheDir . DIRECTORY_SEPARATOR . 'fosJsRouting' . DIRECTORY_SEPARATOR . 'data.json', $extractor->getCachePath('')); }
public function testGetCachePathWithSets() { $router = $this->getMock('Symfony\\Component\\Routing\\Router', array(), array(), '', false); $extractor = new ExposedRoutesExtractor($router, array(), $this->cacheDir, array()); $cacheDir = $this->cacheDir . DIRECTORY_SEPARATOR . 'fosJsRouting' . DIRECTORY_SEPARATOR; $this->assertEquals($cacheDir . 'data.bc862c2.json', $extractor->getCachePath('', array('one-set'))); $this->assertEquals($cacheDir . 'data.59d8b65.json', $extractor->getCachePath('', array('set1', 'set2'))); $this->assertEquals($cacheDir . 'data.59d8b65.json', $extractor->getCachePath('', array('set2', 'set1'))); }