mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
Use UserFactory::newAnonymous instead of deprecated User::newFromId
Change-Id: I4ae99f1118ce23708a07b0dcc69ddba248dafb9f
This commit is contained in:
parent
7a79602208
commit
fb573fdb2b
|
@ -246,12 +246,13 @@ class PopupsHooksTest extends MediaWikiIntegrationTestCase {
|
|||
$isCodeLoaded, $isTitleExcluded ) {
|
||||
$skinMock = $this->createMock( Skin::class );
|
||||
|
||||
$user = $this->getServiceContainer()->getUserFactory()->newAnonymous();
|
||||
$outPageMock = $this->createMock( OutputPage::class );
|
||||
$outPageMock->expects( $isCodeLoaded ? $this->once() : $this->never() )
|
||||
->method( 'addModules' )
|
||||
->with( [ 'ext.popups' ] );
|
||||
$outPageMock->method( 'getUser' )
|
||||
->willReturn( User::newFromId( 0 ) );
|
||||
->willReturn( $user );
|
||||
|
||||
$contextMock = $this->createMock( PopupsContext::class );
|
||||
|
||||
|
@ -281,7 +282,7 @@ class PopupsHooksTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers ::onMakeGlobalVariablesScript
|
||||
*/
|
||||
public function testOnMakeGlobalVariablesScript() {
|
||||
$user = User::newFromId( 0 );
|
||||
$user = $this->getServiceContainer()->getUserFactory()->newAnonymous();
|
||||
|
||||
$outputPage = $this->createMock( OutputPage::class );
|
||||
$outputPage->method( 'getUser' )
|
||||
|
|
Loading…
Reference in a new issue