Fix typo in tests/phpunit/includes/Revision/MainSlotRoleHandlerTest.php
[lhc/web/wiklou.git] / tests / phpunit / includes / CommentStoreTest.php
index 0c5d8e3..4360343 100644 (file)
@@ -115,15 +115,23 @@ class CommentStoreTest extends MediaWikiLangTestCase {
                        ],
                        'Image, write-both' => [
                                MIGRATION_WRITE_BOTH, 'img_description',
-                               [ 'img_description_old' => 'img_description', 'img_description_pk' => 'img_name' ],
+                               [
+                                       'img_description_old' => 'img_description',
+                                       'img_description_id' => 'img_description_id'
+                               ],
                        ],
                        'Image, write-new' => [
                                MIGRATION_WRITE_NEW, 'img_description',
-                               [ 'img_description_old' => 'img_description', 'img_description_pk' => 'img_name' ],
+                               [
+                                       'img_description_old' => 'img_description',
+                                       'img_description_id' => 'img_description_id'
+                               ],
                        ],
                        'Image, new' => [
                                MIGRATION_NEW, 'img_description',
-                               [ 'img_description_pk' => 'img_name' ],
+                               [
+                                       'img_description_id' => 'img_description_id'
+                               ],
                        ],
                ];
        }
@@ -285,7 +293,6 @@ class CommentStoreTest extends MediaWikiLangTestCase {
                        'Image, write-both' => [
                                MIGRATION_WRITE_BOTH, 'img_description', [
                                        'tables' => [
-                                               'temp_img_description' => 'image_comment_temp',
                                                'comment_img_description' => 'comment',
                                        ],
                                        'fields' => [
@@ -294,16 +301,15 @@ class CommentStoreTest extends MediaWikiLangTestCase {
                                                'img_description_cid' => 'comment_img_description.comment_id',
                                        ],
                                        'joins' => [
-                                               'temp_img_description' => [ 'LEFT JOIN', 'temp_img_description.imgcomment_name = img_name' ],
                                                'comment_img_description' => [ 'LEFT JOIN',
-                                                       'comment_img_description.comment_id = temp_img_description.imgcomment_description_id' ],
+                                                       'comment_img_description.comment_id = img_description_id',
+                                               ],
                                        ],
                                ],
                        ],
                        'Image, write-new' => [
                                MIGRATION_WRITE_NEW, 'img_description', [
                                        'tables' => [
-                                               'temp_img_description' => 'image_comment_temp',
                                                'comment_img_description' => 'comment',
                                        ],
                                        'fields' => [
@@ -312,16 +318,15 @@ class CommentStoreTest extends MediaWikiLangTestCase {
                                                'img_description_cid' => 'comment_img_description.comment_id',
                                        ],
                                        'joins' => [
-                                               'temp_img_description' => [ 'LEFT JOIN', 'temp_img_description.imgcomment_name = img_name' ],
                                                'comment_img_description' => [ 'LEFT JOIN',
-                                                       'comment_img_description.comment_id = temp_img_description.imgcomment_description_id' ],
+                                                       'comment_img_description.comment_id = img_description_id',
+                                               ],
                                        ],
                                ],
                        ],
                        'Image, new' => [
                                MIGRATION_NEW, 'img_description', [
                                        'tables' => [
-                                               'temp_img_description' => 'image_comment_temp',
                                                'comment_img_description' => 'comment',
                                        ],
                                        'fields' => [
@@ -330,9 +335,9 @@ class CommentStoreTest extends MediaWikiLangTestCase {
                                                'img_description_cid' => 'comment_img_description.comment_id',
                                        ],
                                        'joins' => [
-                                               'temp_img_description' => [ 'JOIN', 'temp_img_description.imgcomment_name = img_name' ],
                                                'comment_img_description' => [ 'JOIN',
-                                                       'comment_img_description.comment_id = temp_img_description.imgcomment_description_id' ],
+                                                       'comment_img_description.comment_id = img_description_id',
+                                               ],
                                        ],
                                ],
                        ],
@@ -736,11 +741,14 @@ class CommentStoreTest extends MediaWikiLangTestCase {
         * @param int $stage
         */
        public function testInsertWithTempTableDeprecated( $stage ) {
-               $wrap = TestingAccessWrapper::newFromClass( CommentStore::class );
-               $wrap->formerTempTables += [ 'ipb_reason' => '1.30' ];
+               $store = $this->makeStore( $stage );
+               $wrap = TestingAccessWrapper::newFromObject( $store );
+               $wrap->tempTables += [ 'ipb_reason' => [
+                       'stage' => MIGRATION_NEW,
+                       'deprecatedIn' => '1.30',
+               ] ];
 
                $this->hideDeprecated( 'CommentStore::insertWithTempTable for ipb_reason' );
-               $store = $this->makeStore( $stage );
                list( $fields, $callback ) = $store->insertWithTempTable( $this->db, 'ipb_reason', 'foo' );
                $this->assertTrue( is_callable( $callback ) );
        }