Make testFormatValueRestrictions() account for $wgArticlePath to avoid failures
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 25 Oct 2018 03:34:41 +0000 (20:34 -0700)
committerKrinkle <krinklemail@gmail.com>
Thu, 25 Oct 2018 21:14:34 +0000 (21:14 +0000)
Follows-up 170c49d61cb84411.

Change-Id: I37a57b5ece939c5743b7d08d02ce41c71daee5eb

tests/phpunit/includes/specials/pagers/BlockListPagerTest.php

index a05cbbd..80df1d0 100644 (file)
@@ -111,6 +111,8 @@ class BlockListPagerTest extends MediaWikiTestCase {
         * @covers ::formatValue
         */
        public function testFormatValueRestrictions() {
+               $this->setMwGlobals( 'wgArticlePath', '/wiki/$1' );
+
                $pager = new BlockListPager( new SpecialPage(),  [] );
 
                $row = (object)[
@@ -140,10 +142,11 @@ class BlockListPagerTest extends MediaWikiTestCase {
 
                $formatted = $pager->formatValue( 'ipb_params', '' );
                $this->assertEquals( '<ul><li>'
+                       // FIXME: Expectation value should not be dynamic
+                       // and must not depend on a localisation message.
+                       // TODO: Mock the message or consider using qqx.
                        . wfMessage( 'blocklist-editing' )->text()
-                       . '<ul><li><a href="/index.php/'
-                       . $title->getDBKey()
-                       . '" title="'
+                       . '<ul><li><a href="/wiki/Victor_Frankenstein" title="'
                        . $pageName
                        . '">'
                        . $pageName