public function testCreateRouteControllers() { $generatedRoutes = array(); for ($i = 1; $i <= 9; $i++) { $generatedRoutes[] = array('url' => 'Test' . $i, 'lastmod' => '2000-01-0' . $i, 'changefreq' => 'daily', 'priority' => 0.5); } $this->mockedSiteMapControllerService->method('createRouteControllers')->willReturn($generatedRoutes); $this->assertEquals($generatedRoutes, $this->mockedSiteMapControllerService->createRouteControllers($this->route, $this->sitemapInfo)); }
/** * Generating sitemap urls. * The urls be used in the sitemap xml file. * * @return mixed Generated sitemap urls for sitemap xml. */ public function generateSitemapUrls() { $createdSitemapUrls = array(); foreach ($this->routes as $route => $params) { if ($this->siteMapOptionService->hasSitemapOption($params)) { array_push($createdSitemapUrls, $this->siteMapControllerService->createRouteControllers($route, $this->siteMapOptionService->getSitemapOptions($params))); } } return $createdSitemapUrls; }