diff options
author | Brian Wolff <bawolff+wn@gmail.com> | 2022-07-25 13:46:30 -0700 |
---|---|---|
committer | Krinkle <krinkle@fastmail.com> | 2022-07-25 20:51:51 +0000 |
commit | f79ea410723a89cfe70d1ad3c4720f84ff5058e3 (patch) | |
tree | 22e8b9f62c741ed222cbc29bcc7cfded1efc1c92 /tests/phpunit/includes/parser/ParserCacheTest.php | |
parent | 8f610cda16116beea0e6475d6c60b0d06ef586d3 (diff) | |
download | mediawikicore-f79ea410723a89cfe70d1ad3c4720f84ff5058e3.tar.gz mediawikicore-f79ea410723a89cfe70d1ad3c4720f84ff5058e3.zip |
parser: Mock WikiPage::getContentModel in ParserCacheTest to fix php8.1
PHP 8.1 doesn't like this returning null.
Bug: T313663
Change-Id: I59eb21301aab946b6362fea956b398337af8d971
Diffstat (limited to 'tests/phpunit/includes/parser/ParserCacheTest.php')
-rw-r--r-- | tests/phpunit/includes/parser/ParserCacheTest.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/phpunit/includes/parser/ParserCacheTest.php b/tests/phpunit/includes/parser/ParserCacheTest.php index 4cb4e17576d8..cd24de784751 100644 --- a/tests/phpunit/includes/parser/ParserCacheTest.php +++ b/tests/phpunit/includes/parser/ParserCacheTest.php @@ -477,6 +477,7 @@ class ParserCacheTest extends MediaWikiIntegrationTestCase { $options->setOption( $this->getDummyUsedOptions()[0], 'value1' ); $wikiPageMock = $this->createMock( WikiPage::class ); + $wikiPageMock->method( 'getContentModel' )->willReturn( 'wikitext' ); $wikiPageFactoryMock = $this->createMock( WikiPageFactory::class ); $wikiPageFactoryMock->method( 'newFromTitle' ) ->with( $this->page ) @@ -527,6 +528,7 @@ class ParserCacheTest extends MediaWikiIntegrationTestCase { $mockPage = $this->createNoOpMock( PageRecord::class, [ 'exists', 'assertWiki' ] ); $mockPage->method( 'exists' )->willReturn( false ); $wikiPageMock = $this->createMock( WikiPage::class ); + $wikiPageMock->method( 'getContentModel' )->willReturn( 'wikitext' ); $wikiPageFactoryMock = $this->createMock( WikiPageFactory::class ); $wikiPageFactoryMock->method( 'newFromTitle' ) ->with( $mockPage ) |