/** * @dataProvider getPageDeleteNoticeHtmlProvider */ public function testGetPageDeleteNoticeHtml($expected, Title $title, $message) { $siteLinkLookup = $this->getMock('Wikibase\\Lib\\Store\\SiteLinkTable', array('getItemIdForSiteLink'), array('SiteLinkTable', true)); $siteLinkLookup->expects($this->any())->method('getItemIdForSiteLink')->will($this->returnValue(new ItemId('Q4880'))); $deletePageNotice = new DeletePageNoticeCreator($siteLinkLookup, 'dewiki', $this->getRepoLinker()); $this->assertEquals($expected, $deletePageNotice->getPageDeleteNoticeHtml($title), $message); }
/** * Notify the user that we have automatically updated the repo or that they * need to do that per hand. * * @param Title $title * @param OutputPage $out * * @return bool */ public static function onArticleDeleteAfterSuccess(Title $title, OutputPage $out) { $wikibaseClient = WikibaseClient::getDefaultInstance(); $siteLinkLookup = $wikibaseClient->getStore()->getSiteLinkLookup(); $repoLinker = $wikibaseClient->newRepoLinker(); $deletePageNotice = new DeletePageNoticeCreator($siteLinkLookup, $wikibaseClient->getSettings()->getSetting('siteGlobalID'), $repoLinker); $html = $deletePageNotice->getPageDeleteNoticeHtml($title); $out->addHTML($html); return true; }