/** * @dataProvider isSitemapPageDataProvider */ public function testIsSitemapPage($enableHomePage, $articleName, $exp) { $this->mockGlobalVariable('wgCityId', self::TEST_CITY_ID); $this->mockGlobalVariable('wgEnableWikiaHomePageExt', $enableHomePage); $title = Title::newFromText($articleName); $sitemap = new SitemapPageModel(); $isSitemapPage = $sitemap->isSitemapPage($title); $this->assertEquals($exp, $isSitemapPage); }
/** * @param Title $title * @param Article $article * @return boolean */ public static function onArticleFromTitle(&$title, &$article) { $app = F::app(); $sitemapPage = new SitemapPageModel(); if ($sitemapPage->isSitemapPage($title)) { $app->wg->SuppressPageHeader = true; $app->wg->SuppressWikiHeader = true; $app->wg->SuppressRail = true; $app->wg->SuppressFooter = true; $article = new SitemapPageArticle($title); } return true; }