aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit')
-rw-r--r--tests/phpunit/mocks/MockTitleTrait.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/phpunit/mocks/MockTitleTrait.php b/tests/phpunit/mocks/MockTitleTrait.php
index d13459bab516..c24134062832 100644
--- a/tests/phpunit/mocks/MockTitleTrait.php
+++ b/tests/phpunit/mocks/MockTitleTrait.php
@@ -72,8 +72,10 @@ trait MockTitleTrait {
// TODO getPageLanguage should return a Language object, 'qqx' is a string
$title->method( 'getPageLanguage' )->willReturn( $props['language'] ?? 'qqx' );
- $title->method( 'getContentModel' )
- ->willReturn( $props['contentModel'] ?? CONTENT_MODEL_WIKITEXT );
+ $contentModel = $props['contentModel'] ?? CONTENT_MODEL_WIKITEXT;
+ $title->method( 'getContentModel' )->willReturn( $contentModel );
+ $title->method( 'hasContentModel' )->willReturnCallback(
+ static fn ( $id ) => $id === $contentModel );
$title->method( 'getTitleProtection' )->willReturn( false );
$title->method( 'canExist' )
->willReturn( $ns >= 0 && empty( $props['interwiki'] ) && $text !== '' );