X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fpage%2FWikiPageTest.php;h=a9f74b6472a620005917be2f2d604810bfde81e8;hp=6b911bf3a67af38937afa0febf158add65f55635;hb=e7720b8f8e09287384ddee271641d1b1721318bb;hpb=55043101b2a89ea1e811b6d35e415f57ed0bf41d diff --git a/tests/phpunit/includes/page/WikiPageTest.php b/tests/phpunit/includes/page/WikiPageTest.php index 6b911bf3a6..a9f74b6472 100644 --- a/tests/phpunit/includes/page/WikiPageTest.php +++ b/tests/phpunit/includes/page/WikiPageTest.php @@ -117,7 +117,7 @@ class WikiPageTest extends MediaWikiLangTestCase { $id = $page->getId(); # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] ); $n = $res->numRows(); $res->free(); @@ -147,7 +147,7 @@ class WikiPageTest extends MediaWikiLangTestCase { $this->assertTrue( $content->equals( $retrieved ), 'retrieved content doesn\'t equal original' ); # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] ); $n = $res->numRows(); $res->free(); @@ -195,7 +195,7 @@ class WikiPageTest extends MediaWikiLangTestCase { $jobs->execute(); # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] ); $n = $res->numRows(); $res->free(); @@ -225,7 +225,7 @@ class WikiPageTest extends MediaWikiLangTestCase { $jobs->execute(); # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] ); $n = $res->numRows(); $res->free(); @@ -549,7 +549,11 @@ class WikiPageTest extends MediaWikiLangTestCase { public static function provideGetParserOutput() { return [ - [ CONTENT_MODEL_WIKITEXT, "hello ''world''\n", "

hello world

" ], + [ + CONTENT_MODEL_WIKITEXT, + "hello ''world''\n", + "

hello world

" + ], // @todo more...? ]; } @@ -566,7 +570,7 @@ class WikiPageTest extends MediaWikiLangTestCase { $text = $po->getText(); $text = trim( preg_replace( '//sm', '', $text ) ); # strip injected comments - $text = preg_replace( '!\s*(

)!sm', '\1', $text ); # don't let tidy confuse us + $text = preg_replace( '!\s*(

|)!sm', '\1', $text ); # don't let tidy confuse us $this->assertEquals( $expectedHtml, $text ); @@ -621,15 +625,15 @@ more stuff return [ [ 'Help:WikiPageTest_testReplaceSection', CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, + self::$sections, "0", "No more", null, - trim( preg_replace( '/^Intro/sm', 'No more', WikiPageTest::$sections ) ) + trim( preg_replace( '/^Intro/sm', 'No more', self::$sections ) ) ], [ 'Help:WikiPageTest_testReplaceSection', CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, + self::$sections, "", "No more", null, @@ -637,29 +641,29 @@ more stuff ], [ 'Help:WikiPageTest_testReplaceSection', CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, + self::$sections, "2", "== TEST ==\nmore fun", null, trim( preg_replace( '/^== test ==.*== foo ==/sm', "== TEST ==\nmore fun\n\n== foo ==", - WikiPageTest::$sections ) ) + self::$sections ) ) ], [ 'Help:WikiPageTest_testReplaceSection', CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, + self::$sections, "8", "No more", null, - trim( WikiPageTest::$sections ) + trim( self::$sections ) ], [ 'Help:WikiPageTest_testReplaceSection', CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, + self::$sections, "new", "No more", "New", - trim( WikiPageTest::$sections ) . "\n\n== New ==\n\nNo more" + trim( self::$sections ) . "\n\n== New ==\n\nNo more" ], ]; } @@ -823,7 +827,7 @@ more stuff # we are having issues with doRollback spuriously failing. Apparently # the last revision somehow goes missing or not committed under some # circumstances. So, make sure the last revision has the right user name. - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $this->assertEquals( 3, Revision::countByPageId( $dbr, $page->getId() ) ); $page = new WikiPage( $page->getTitle() );