X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2FWikiPageTest.php;h=7f7945b8d819645e28ce378c40dbf3ff515dfadb;hb=6ab14151766918b9c7abf33580cdd64b9f9e79e4;hp=37f197515bbda3ab4f128839bce53ad640928ee8;hpb=82b8b578938bf75bc9fa924aa95b10955d49ec6f;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/WikiPageTest.php b/tests/phpunit/includes/WikiPageTest.php index 37f197515b..7f7945b8d8 100644 --- a/tests/phpunit/includes/WikiPageTest.php +++ b/tests/phpunit/includes/WikiPageTest.php @@ -499,6 +499,10 @@ class WikiPageTest extends MediaWikiLangTestCase { * @covers WikiPage::getRedirectTarget */ public function testGetRedirectTarget( $title, $model, $text, $target ) { + $this->setMwGlobals( array( + 'wgCapitalLinks' => true, + ) ); + $page = $this->createPage( $title, $text, $model ); # sanity check, because this test seems to fail for no reason for some people. @@ -817,6 +821,22 @@ more stuff $this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getNativeData() ) ); } + /** + * @dataProvider dataReplaceSection + * @covers WikiPage::replaceSectionAtRev + */ + public function testReplaceSectionAtRev( $title, $model, $text, $section, + $with, $sectionTitle, $expected + ) { + $page = $this->createPage( $title, $text, $model ); + $baseRevId = $page->getLatest(); + + $content = ContentHandler::makeContent( $with, $page->getTitle(), $page->getContentModel() ); + $c = $page->replaceSectionAtRev( $section, $content, $sectionTitle, $baseRevId ); + + $this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getNativeData() ) ); + } + /* @todo FIXME: fix this! public function testGetUndoText() { $this->checkHasDiff3();