X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fdeferred%2FLinksUpdateTest.php;h=ddc0798f1ae19d369dbed1c0df0ffb4a598b98f4;hb=dbad540cd37617879aff6f28ce9c016dd8049d4e;hp=9cc3ffdab78b84272f0846f0c693b73c0e57fb89;hpb=61898ad28ed69c5b391eb43e0db9386279b9612c;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/deferred/LinksUpdateTest.php b/tests/phpunit/includes/deferred/LinksUpdateTest.php index 9cc3ffdab7..ddc0798f1a 100644 --- a/tests/phpunit/includes/deferred/LinksUpdateTest.php +++ b/tests/phpunit/includes/deferred/LinksUpdateTest.php @@ -1,6 +1,7 @@ assertRecentChangeByCategorization( $title, - $wikiPage->getParserOutput( new ParserOptions() ), + $wikiPage->getParserOutput( ParserOptions::newCanonical() ), Title::newFromText( 'Category:Foo' ), [ [ 'Foo', '[[:Testing]] added to category' ] ] ); @@ -177,7 +178,7 @@ class LinksUpdateTest extends MediaWikiLangTestCase { $this->assertRecentChangeByCategorization( $title, - $wikiPage->getParserOutput( new ParserOptions() ), + $wikiPage->getParserOutput( ParserOptions::newCanonical() ), Title::newFromText( 'Category:Foo' ), [ [ 'Foo', '[[:Testing]] added to category' ], @@ -187,7 +188,7 @@ class LinksUpdateTest extends MediaWikiLangTestCase { $this->assertRecentChangeByCategorization( $title, - $wikiPage->getParserOutput( new ParserOptions() ), + $wikiPage->getParserOutput( ParserOptions::newCanonical() ), Title::newFromText( 'Category:Bar' ), [ [ 'Bar', '[[:Testing]] added to category' ], @@ -211,7 +212,7 @@ class LinksUpdateTest extends MediaWikiLangTestCase { $this->assertRecentChangeByCategorization( $templateTitle, - $templatePage->getParserOutput( new ParserOptions() ), + $templatePage->getParserOutput( ParserOptions::newCanonical() ), Title::newFromText( 'Baz' ), [] ); @@ -221,7 +222,7 @@ class LinksUpdateTest extends MediaWikiLangTestCase { $this->assertRecentChangeByCategorization( $templateTitle, - $templatePage->getParserOutput( new ParserOptions() ), + $templatePage->getParserOutput( ParserOptions::newCanonical() ), Title::newFromText( 'Baz' ), [ [ 'Baz', @@ -378,16 +379,33 @@ class LinksUpdateTest extends MediaWikiLangTestCase { protected function assertRecentChangeByCategorization( Title $pageTitle, ParserOutput $parserOutput, Title $categoryTitle, $expectedRows ) { - $this->assertSelect( - 'recentchanges', - 'rc_title, rc_comment', - [ - 'rc_type' => RC_CATEGORIZE, - 'rc_namespace' => NS_CATEGORY, - 'rc_title' => $categoryTitle->getDBkey() - ], - $expectedRows - ); + global $wgCommentTableSchemaMigrationStage; + + if ( $wgCommentTableSchemaMigrationStage <= MIGRATION_WRITE_BOTH ) { + $this->assertSelect( + 'recentchanges', + 'rc_title, rc_comment', + [ + 'rc_type' => RC_CATEGORIZE, + 'rc_namespace' => NS_CATEGORY, + 'rc_title' => $categoryTitle->getDBkey() + ], + $expectedRows + ); + } + if ( $wgCommentTableSchemaMigrationStage >= MIGRATION_WRITE_BOTH ) { + $this->assertSelect( + [ 'recentchanges', 'comment' ], + 'rc_title, comment_text', + [ + 'rc_type' => RC_CATEGORIZE, + 'rc_namespace' => NS_CATEGORY, + 'rc_title' => $categoryTitle->getDBkey(), + 'comment_id = rc_comment_id', + ], + $expectedRows + ); + } } private function runAllRelatedJobs() {