From: daniel Date: Fri, 31 Aug 2018 10:49:19 +0000 (+0200) Subject: Add test for {{subst:REVISIONUSER}} X-Git-Tag: 1.34.0-rc.0~4242^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/%7B%24www_url%7Dadmin/compta/%5B%28?a=commitdiff_plain;h=8a650c4aca0e5c421b8fc677e9e69e0ed68d3415;p=lhc%2Fweb%2Fwiklou.git Add test for {{subst:REVISIONUSER}} This tests that revision meta-data is available for Pre-Save Transform. Change-Id: I62f73ea24784b539cdf8229aeb1f8efa62631248 --- 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'; + } + ]; } /**