Fix typo in tests/phpunit/includes/Revision/MainSlotRoleHandlerTest.php
[lhc/web/wiklou.git] / tests / phpunit / includes / RevisionTest.php
index c053104..20689d6 100644 (file)
@@ -281,10 +281,14 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers \MediaWiki\Revision\RevisionStore::newMutableRevisionFromArray
         */
        public function testConstructFromRowWithBadPageId() {
-               $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
+               $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_NEW );
                $this->overrideMwServices();
                Wikimedia\suppressWarnings();
-               $rev = new Revision( (object)[ 'rev_page' => 77777777 ] );
+               $rev = new Revision( (object)[
+                       'rev_page' => 77777777,
+                       'rev_comment_text' => '',
+                       'rev_comment_data' => null,
+               ] );
                $this->assertSame( 77777777, $rev->getPage() );
                Wikimedia\restoreWarnings();
        }
@@ -474,6 +478,7 @@ class RevisionTest extends MediaWikiTestCase {
                        MediaWikiServices::getInstance()->getCommentStore(),
                        MediaWikiServices::getInstance()->getContentModelStore(),
                        MediaWikiServices::getInstance()->getSlotRoleStore(),
+                       MediaWikiServices::getInstance()->getSlotRoleRegistry(),
                        MIGRATION_OLD,
                        MediaWikiServices::getInstance()->getActorMigration()
                );
@@ -560,9 +565,9 @@ class RevisionTest extends MediaWikiTestCase {
                $row = new stdClass;
                $row->old_text = "Wiki est l'\xc3\xa9cole superieur !";
                $row->old_flags = Revision::compressRevisionText( $row->old_text );
-               $this->assertTrue( false !== strpos( $row->old_flags, 'utf-8' ),
+               $this->assertTrue( strpos( $row->old_flags, 'utf-8' ) !== false,
                        "Flags should contain 'utf-8'" );
-               $this->assertFalse( false !== strpos( $row->old_flags, 'gzip' ),
+               $this->assertFalse( strpos( $row->old_flags, 'gzip' ) !== false,
                        "Flags should not contain 'gzip'" );
                $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !",
                        $row->old_text, "Direct check" );
@@ -583,9 +588,9 @@ class RevisionTest extends MediaWikiTestCase {
                $row = new stdClass;
                $row->old_text = "Wiki est l'\xc3\xa9cole superieur !";
                $row->old_flags = Revision::compressRevisionText( $row->old_text );
-               $this->assertTrue( false !== strpos( $row->old_flags, 'utf-8' ),
+               $this->assertTrue( strpos( $row->old_flags, 'utf-8' ) !== false,
                        "Flags should contain 'utf-8'" );
-               $this->assertTrue( false !== strpos( $row->old_flags, 'gzip' ),
+               $this->assertTrue( strpos( $row->old_flags, 'gzip' ) !== false,
                        "Flags should contain 'gzip'" );
                $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !",
                        gzinflate( $row->old_text ), "Direct check" );
@@ -597,7 +602,7 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers Revision::loadFromTitle
         */
        public function testLoadFromTitle() {
-               $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
+               $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_NEW );
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_OLD );
                $this->overrideMwServices();
                $title = $this->getMockTitle();
@@ -634,7 +639,10 @@ class RevisionTest extends MediaWikiTestCase {
                $db->expects( $this->once() )
                        ->method( 'selectRow' )
                        ->with(
-                               $this->equalTo( [ 'revision', 'page', 'user' ] ),
+                               $this->equalTo( [
+                                       'revision', 'page', 'user',
+                                       'temp_rev_comment' => 'revision_comment_temp', 'comment_rev_comment' => 'comment',
+                               ] ),
                                // We don't really care about the fields are they come from the selectField methods
                                $this->isType( 'array' ),
                                $this->equalTo( $conditions ),