mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TextExtracts
synced 2024-11-23 15:56:52 +00:00
Tests: Use more complete mock to prevent php8.1 deprecated warnings
Fixes: 1) TextExtracts\Test\ApiQueryExtractsTest::testMemCacheHelpers strtr(): Passing null to parameter #1 ($string) of type string is deprecated Change-Id: Id39cb89bb5d49fbea543181da678b191f70311ac
This commit is contained in:
parent
1ce6d8861a
commit
c77adce065
|
@ -49,9 +49,12 @@ class ApiQueryExtractsTest extends \MediaWikiIntegrationTestCase {
|
|||
->method( 'getMain' )
|
||||
->willReturn( $main );
|
||||
|
||||
$langConv = $this->createMock( ILanguageConverter::class );
|
||||
$langConv->method( 'getPreferredVariant' )
|
||||
->willReturn( 'en' );
|
||||
$langConvFactory = $this->createMock( LanguageConverterFactory::class );
|
||||
$langConvFactory->method( 'getLanguageConverter' )
|
||||
->willReturn( $this->createMock( ILanguageConverter::class ) );
|
||||
->willReturn( $langConv );
|
||||
|
||||
return new ApiQueryExtracts(
|
||||
$query,
|
||||
|
@ -71,6 +74,10 @@ class ApiQueryExtractsTest extends \MediaWikiIntegrationTestCase {
|
|||
$page = $this->createMock( \WikiPage::class );
|
||||
$page->method( 'getTitle' )
|
||||
->willReturn( $title );
|
||||
$page->method( 'getId' )
|
||||
->willReturn( 123 );
|
||||
$page->method( 'getTouched' )
|
||||
->willReturn( '20010101000000' );
|
||||
|
||||
$text = 'Text to cache';
|
||||
|
||||
|
|
Loading…
Reference in a new issue