/**
  * testIsExistCachedSiteInstanceRoutesWithDebugMode
  *
  * @return void
  */
 public function testIsExistCachedSiteInstanceRoutesWithDebugMode()
 {
     $cache = $this->cache;
     $cacheHandler = new InstanceRouteCacheHandler($cache, true);
     $exist = $cacheHandler->isExistCachedSiteInstanceRoutes('default');
     $this->assertEquals(false, $exist);
 }
 /**
  * Get All Instance Route of site
  * return list of all Instance Route from Repo
  *
  * @param string $siteKey to get siteKey
  *
  * @return InstanceRoute[]
  */
 public function getsBySite($siteKey)
 {
     if ($this->cache->isExistCachedSiteInstanceRoutes($siteKey)) {
         $instanceRoutes = $this->cache->getCachedSiteInstanceRoutes($siteKey);
         array_merge($this->loadedInstanceRoutes, $instanceRoutes);
         return $instanceRoutes;
     }
     $filter = function ($query) use($siteKey) {
         return $query->where('site', '=', $siteKey);
     };
     $instanceRoutes = $this->instanceRouteRepository->fetch($filter);
     $this->loadedInstanceRoutes = array_merge($this->loadedInstanceRoutes, $instanceRoutes);
     $this->cache->setSiteInstanceCache($siteKey, $instanceRoutes);
     return $instanceRoutes;
 }