aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/language/LocalizationUpdateSpyTrait.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2025-02-17 12:36:00 +1100
committerTim Starling <tstarling@wikimedia.org>2025-02-21 12:01:38 +1100
commit1edccf294ac00b304400738a812358e6da252403 (patch)
tree0f414904640a00b0739fae9a83226c2f640f1eb3 /tests/phpunit/includes/language/LocalizationUpdateSpyTrait.php
parentc40e70a6f8368fc6785c35c739748e5e8d83a47d (diff)
downloadmediawikicore-1edccf294ac00b304400738a812358e6da252403.tar.gz
mediawikicore-1edccf294ac00b304400738a812358e6da252403.zip
Split MessageParser out of MessageCache
MessageCache has enough to do without also being a parser. Split a MessageParser class out of MessageCache and make it a service. * MessageCache::parseWithPostprocessing() becomes MessageParser::parse() because every caller wants postprocessing so it makes sense to use the shorter name for this. * MessageCache::parse() becomes MessageParser ::parseWithoutPostprocessing(). I changed the return type from ParserOutput|string to ParserOutput, which is a followup to I8a1fa84e650d920d07d74722d8059d5afeedec6b. Narrowing the return type does not break b/c so it is possible to make this change for both variants. * In the new methods, a null title is always a convenience alias for a placeholder title (Special:Badtitle). This reflects the convention in Parser::setPage(). The old MessageCache::parse() retains its b/c fallback to $wgTitle. MessageCache::transform() had the potential to fall back to the title used in the previous call, a fragile mechanism which I removed without deprecation. * For consistency, allow a string language in all new methods. * In EmailNotification, clean up an early attempt at global state avoidance. Change-Id: I05ab21508d5f8394189fd41ac6a2254ac0e0d785
Diffstat (limited to 'tests/phpunit/includes/language/LocalizationUpdateSpyTrait.php')
-rw-r--r--tests/phpunit/includes/language/LocalizationUpdateSpyTrait.php3
1 files changed, 0 insertions, 3 deletions
diff --git a/tests/phpunit/includes/language/LocalizationUpdateSpyTrait.php b/tests/phpunit/includes/language/LocalizationUpdateSpyTrait.php
index 0a7aaed1b054..05b3d037f2a1 100644
--- a/tests/phpunit/includes/language/LocalizationUpdateSpyTrait.php
+++ b/tests/phpunit/includes/language/LocalizationUpdateSpyTrait.php
@@ -41,9 +41,6 @@ trait LocalizationUpdateSpyTrait {
$messageCache->method( 'get' )
->willReturn( 'dummy test' );
- $messageCache->method( 'transform' )
- ->willReturn( 'dummy test' );
-
$messageCache->method( 'getMsgFromNamespace' )
->willReturn( false );