aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/parser
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2025-03-14 16:06:54 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2025-03-14 16:06:54 +0000
commitcc5e58b9871197120da2cd3c7fb4533e2238b292 (patch)
tree7407649fdbc38bf1ef0eab9229d21a99cd1341a2 /tests/phpunit/includes/parser
parent2e7972f5209bc47598ca0eb477edac3183627aac (diff)
parente2d001c24960985aa403a5be55b14834bb7f3557 (diff)
downloadmediawikicore-cc5e58b9871197120da2cd3c7fb4533e2238b292.tar.gz
mediawikicore-cc5e58b9871197120da2cd3c7fb4533e2238b292.zip
Merge "parser: Fix zero-based (?) month in MagicVariableTest"
Diffstat (limited to 'tests/phpunit/includes/parser')
-rw-r--r--tests/phpunit/includes/parser/MagicVariableTest.php7
1 files changed, 1 insertions, 6 deletions
diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php
index afe7e306ec5d..214c40169f9c 100644
--- a/tests/phpunit/includes/parser/MagicVariableTest.php
+++ b/tests/phpunit/includes/parser/MagicVariableTest.php
@@ -287,12 +287,7 @@ class MagicVariableTest extends MediaWikiIntegrationTestCase {
private function assertMagicPadding( $magic, $value, $format ) {
# Initialize parser timestamp as year 2010 at 12h34 56s.
# month and day are given by the caller ($value). Month < 12!
- if ( $value > 12 ) {
- $month = $value % 12;
- } else {
- $month = $value;
- }
-
+ $month = ( $value + 11 ) % 12 + 1;
$this->setParserTimestamp(
sprintf( '2010%02d%02d123456', $month, $value )
);