X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FStorage%2FRevisionStoreTest.php;h=849894755b3a27c409f80b905a3c308aa74d9df0;hb=27c61fb1e94da9114314468fd00bcf129ec064b6;hp=8e8de6ea3151a2486a3de2f813ac57c922299734;hpb=803f3867b7fcbb5fcee405f5c10cfa06cb857bd6;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/Storage/RevisionStoreTest.php b/tests/phpunit/includes/Storage/RevisionStoreTest.php index 8e8de6ea31..849894755b 100644 --- a/tests/phpunit/includes/Storage/RevisionStoreTest.php +++ b/tests/phpunit/includes/Storage/RevisionStoreTest.php @@ -32,7 +32,8 @@ class RevisionStoreTest extends MediaWikiTestCase { $loadBalancer ? $loadBalancer : $this->getMockLoadBalancer(), $blobStore ? $blobStore : $this->getMockSqlBlobStore(), $WANObjectCache ? $WANObjectCache : $this->getHashWANObjectCache(), - MediaWikiServices::getInstance()->getCommentStore() + MediaWikiServices::getInstance()->getCommentStore(), + MediaWikiServices::getInstance()->getActorMigration() ); } @@ -83,8 +84,6 @@ class RevisionStoreTest extends MediaWikiTestCase { 'rev_page', 'rev_text_id', 'rev_timestamp', - 'rev_user_text', - 'rev_user', 'rev_minor_edit', 'rev_deleted', 'rev_len', @@ -101,6 +100,14 @@ class RevisionStoreTest extends MediaWikiTestCase { ]; } + private function getActorQueryFields() { + return [ + 'rev_user' => 'rev_user', + 'rev_user_text' => 'rev_user_text', + 'rev_actor' => 'NULL', + ]; + } + private function getContentHandlerQueryFields() { return [ 'rev_content_format', @@ -117,6 +124,7 @@ class RevisionStoreTest extends MediaWikiTestCase { 'fields' => array_merge( $this->getDefaultQueryFields(), $this->getCommentQueryFields(), + $this->getActorQueryFields(), $this->getContentHandlerQueryFields() ), 'joins' => [], @@ -129,7 +137,8 @@ class RevisionStoreTest extends MediaWikiTestCase { 'tables' => [ 'revision' ], 'fields' => array_merge( $this->getDefaultQueryFields(), - $this->getCommentQueryFields() + $this->getCommentQueryFields(), + $this->getActorQueryFields() ), 'joins' => [], ] @@ -142,6 +151,7 @@ class RevisionStoreTest extends MediaWikiTestCase { 'fields' => array_merge( $this->getDefaultQueryFields(), $this->getCommentQueryFields(), + $this->getActorQueryFields(), [ 'page_namespace', 'page_title', @@ -164,6 +174,7 @@ class RevisionStoreTest extends MediaWikiTestCase { 'fields' => array_merge( $this->getDefaultQueryFields(), $this->getCommentQueryFields(), + $this->getActorQueryFields(), [ 'user_name', ] @@ -181,6 +192,7 @@ class RevisionStoreTest extends MediaWikiTestCase { 'fields' => array_merge( $this->getDefaultQueryFields(), $this->getCommentQueryFields(), + $this->getActorQueryFields(), [ 'old_text', 'old_flags', @@ -199,6 +211,7 @@ class RevisionStoreTest extends MediaWikiTestCase { 'fields' => array_merge( $this->getDefaultQueryFields(), $this->getCommentQueryFields(), + $this->getActorQueryFields(), $this->getContentHandlerQueryFields(), [ 'page_namespace', @@ -227,6 +240,7 @@ class RevisionStoreTest extends MediaWikiTestCase { */ public function testGetQueryInfo( $contentHandlerUseDb, $options, $expected ) { $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD ); + $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', MIGRATION_OLD ); $this->overrideMwServices(); $store = $this->getRevisionStore(); $store->setContentHandlerUseDB( $contentHandlerUseDb ); @@ -243,8 +257,6 @@ class RevisionStoreTest extends MediaWikiTestCase { 'ar_text', 'ar_text_id', 'ar_timestamp', - 'ar_user_text', - 'ar_user', 'ar_minor_edit', 'ar_deleted', 'ar_len', @@ -258,6 +270,7 @@ class RevisionStoreTest extends MediaWikiTestCase { */ public function testGetArchiveQueryInfo_contentHandlerDb() { $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD ); + $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', MIGRATION_OLD ); $this->overrideMwServices(); $store = $this->getRevisionStore(); $store->setContentHandlerUseDB( true ); @@ -272,6 +285,9 @@ class RevisionStoreTest extends MediaWikiTestCase { 'ar_comment_text' => 'ar_comment', 'ar_comment_data' => 'NULL', 'ar_comment_cid' => 'NULL', + 'ar_user_text' => 'ar_user_text', + 'ar_user' => 'ar_user', + 'ar_actor' => 'NULL', 'ar_content_format', 'ar_content_model', ] @@ -287,6 +303,7 @@ class RevisionStoreTest extends MediaWikiTestCase { */ public function testGetArchiveQueryInfo_noContentHandlerDb() { $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD ); + $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', MIGRATION_OLD ); $this->overrideMwServices(); $store = $this->getRevisionStore(); $store->setContentHandlerUseDB( false ); @@ -301,6 +318,9 @@ class RevisionStoreTest extends MediaWikiTestCase { 'ar_comment_text' => 'ar_comment', 'ar_comment_data' => 'NULL', 'ar_comment_cid' => 'NULL', + 'ar_user_text' => 'ar_user_text', + 'ar_user' => 'ar_user', + 'ar_actor' => 'NULL', ] ), 'joins' => [],