/** * Tests the main sitemap and also tests the transient cache * * @covers WPSEO_Sitemaps::redirect */ public function test_main_sitemap() { self::$class_instance->reset(); set_query_var('sitemap', 1); // Go to the XML sitemap twice, see if transient cache is set self::$class_instance->redirect($GLOBALS['wp_the_query']); $this->expectOutputContains(array('<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">', '<sitemap>', '<lastmod>', '</sitemapindex>')); self::$class_instance->redirect($GLOBALS['wp_the_query']); $this->expectOutputContains(array('<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">', '<sitemap>', '<lastmod>', '</sitemapindex>', 'Served from transient cache')); }