/** * @dataProvider decideArchiveTitleProvider */ public function testDecideArchiveTitle($message, $expect, Title $source, array $formats, array $exists) { // flip so we can use isset $existsByKey = array_flip($exists); $titleRepo = $this->getMock('Flow\\Repository\\TitleRepository'); $titleRepo->expects($this->any())->method('exists')->will($this->returnCallback(function (Title $title) use($existsByKey) { return isset($existsByKey[$title->getPrefixedText()]); })); $result = Converter::decideArchiveTitle($source, $formats, $titleRepo); $this->assertEquals($expect, $result, $message); }
/** * Flow does not support viewing the history of the wikitext pages it takes * over, so those need to be moved out the way. This method decides that * destination. The archived revisions include the headers displayed with * lqt and potentially any pre-lqt wikitext talk page content. * * @param Title $source * @return Title */ public function decideArchiveTitle(Title $source) { return Converter::decideArchiveTitle($source, array('%s/LQT Archive %d')); }
/** * {@inheritDoc} */ public function decideArchiveTitle(Title $source) { return Converter::decideArchiveTitle($source, $this->archiveTitleSuggestions); }