X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FMergeHistoryTest.php;h=f44ae322727e61555c3d277ff066485055ad24aa;hb=ea22e3d1f6677884d8490d744ca15c65fd34c769;hp=5ea0cdf2d68d914cd9bd6131b3eb3840288c1bd9;hpb=42324aff4e173b70aeed4f520ff0f5b96557d24e;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/MergeHistoryTest.php b/tests/phpunit/includes/MergeHistoryTest.php index 5ea0cdf2d6..f44ae32272 100644 --- a/tests/phpunit/includes/MergeHistoryTest.php +++ b/tests/phpunit/includes/MergeHistoryTest.php @@ -21,10 +21,10 @@ class MergeHistoryTest extends MediaWikiTestCase { /** * @dataProvider provideIsValidMerge * @covers MergeHistory::isValidMerge - * @param $source string Source page - * @param $dest string Destination page - * @param $timestamp string|bool Timestamp up to which revisions are merged (or false for all) - * @param $error string|bool Expected error for test (or true for no error) + * @param string $source Source page + * @param string $dest Destination page + * @param string|bool $timestamp Timestamp up to which revisions are merged (or false for all) + * @param string|bool $error Expected error for test (or true for no error) */ public function testIsValidMerge( $source, $dest, $timestamp, $error ) { $this->setMwGlobals( 'wgContentHandlerUseDB', false ); @@ -97,13 +97,12 @@ class MergeHistoryTest extends MediaWikiTestCase { ); // Sysop with mergehistory permission - $sysop = User::newFromName( 'UTSysop' ); + $sysop = static::getTestSysop()->getUser(); $status = $mh->checkPermissions( $sysop, '' ); $this->assertTrue( $status->isOK() ); // Normal user - $notSysop = User::newFromName( 'UTNotSysop' ); - $notSysop->addToDatabase(); + $notSysop = static::getTestUser()->getUser(); $status = $mh->checkPermissions( $notSysop, '' ); $this->assertTrue( $status->hasMessage( 'mergehistory-fail-permission' ) ); } @@ -118,7 +117,8 @@ class MergeHistoryTest extends MediaWikiTestCase { Title::newFromText( 'Merge2' ) ); - $mh->merge( User::newFromName( 'UTSysop' ) ); + $sysop = static::getTestSysop()->getUser(); + $mh->merge( $sysop ); $this->assertEquals( $mh->getMergedRevisionCount(), 1 ); } }