X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FActorMigrationTest.php;h=c9387507c2ba35ee16388cb4974e9d4c45c79aea;hp=1b0c848bb62230f20950c7bfc24b1adbaa64a87b;hb=733704ed8248f71dfb982d22799104a976d1ada4;hpb=30ec9d51c6c17cd47f25cc74a0517878ed18df10 diff --git a/tests/phpunit/includes/ActorMigrationTest.php b/tests/phpunit/includes/ActorMigrationTest.php index 1b0c848bb6..c9387507c2 100644 --- a/tests/phpunit/includes/ActorMigrationTest.php +++ b/tests/phpunit/includes/ActorMigrationTest.php @@ -1,6 +1,7 @@ [ MIGRATION_OLD, MIGRATION_WRITE_NEW ], - MIGRATION_WRITE_BOTH => [ MIGRATION_OLD, MIGRATION_NEW ], - MIGRATION_WRITE_NEW => [ MIGRATION_WRITE_BOTH, MIGRATION_NEW ], - MIGRATION_NEW => [ MIGRATION_WRITE_BOTH, MIGRATION_NEW ], + MIGRATION_OLD => [ MIGRATION_OLD, MIGRATION_WRITE_BOTH, MIGRATION_WRITE_NEW ], + MIGRATION_WRITE_BOTH => [ MIGRATION_OLD, MIGRATION_WRITE_BOTH, MIGRATION_WRITE_NEW, + MIGRATION_NEW ], + MIGRATION_WRITE_NEW => [ MIGRATION_WRITE_BOTH, MIGRATION_WRITE_NEW, MIGRATION_NEW ], + MIGRATION_NEW => [ MIGRATION_WRITE_BOTH, MIGRATION_WRITE_NEW, MIGRATION_NEW ], ]; $nameKey = $key . '_text'; $actorKey = $key === 'ipb_by' ? 'ipb_by_actor' : substr( $key, 0, -5 ) . '_actor'; - foreach ( $stages as $writeStage => $readRange ) { + foreach ( $stages as $writeStage => $possibleReadStages ) { if ( $key === 'ipb_by' ) { $extraFields['ipb_address'] = __CLASS__ . "#$writeStage"; } @@ -512,7 +514,7 @@ class ActorMigrationTest extends MediaWikiLangTestCase { $callback( $id, $extraFields ); } - for ( $readStage = $readRange[0]; $readStage <= $readRange[1]; $readStage++ ) { + foreach ( $possibleReadStages as $readStage ) { $r = $this->makeMigration( $readStage ); $queryInfo = $r->getJoin( $key ); @@ -634,8 +636,8 @@ class ActorMigrationTest extends MediaWikiLangTestCase { $userIdentity->method( 'getName' )->willReturn( $user->getName() ); $userIdentity->method( 'getActorId' )->willReturn( 0 ); - list( $cFields, $cCallback ) = CommentStore::newKey( 'rev_comment' ) - ->insertWithTempTable( $this->db, '' ); + list( $cFields, $cCallback ) = MediaWikiServices::getInstance()->getCommentStore() + ->insertWithTempTable( $this->db, 'rev_comment', '' ); $m = $this->makeMigration( MIGRATION_WRITE_BOTH ); list( $fields, $callback ) = $m->getInsertValuesWithTempTable( $this->db, 'rev_user', $userIdentity );