From 8a650c4aca0e5c421b8fc677e9e69e0ed68d3415 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 31 Aug 2018 12:49:19 +0200 Subject: [PATCH] Add test for {{subst:REVISIONUSER}} This tests that revision meta-data is available for Pre-Save Transform. Change-Id: I62f73ea24784b539cdf8229aeb1f8efa62631248 --- tests/phpunit/includes/Storage/PageUpdaterTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/phpunit/includes/Storage/PageUpdaterTest.php b/tests/phpunit/includes/Storage/PageUpdaterTest.php index e6ad011524..2805ea88f9 100644 --- a/tests/phpunit/includes/Storage/PageUpdaterTest.php +++ b/tests/phpunit/includes/Storage/PageUpdaterTest.php @@ -523,6 +523,20 @@ class PageUpdaterTest extends MediaWikiTestCase { return $rev->getTimestamp(); } ]; + + yield 'subst:REVISIONUSER' => [ + 'Test {{subst:REVISIONUSER}} Test', + function ( RevisionRecord $rev ) { + return $rev->getUser()->getName(); + } + ]; + + yield 'subst:PAGENAME' => [ + 'Test {{subst:PAGENAME}} Test', + function ( RevisionRecord $rev ) { + return 'PageUpdaterTest::testMagicWords'; + } + ]; } /** -- 2.20.1