Declare LogFormatter::$parsedParameters property
authorKunal Mehta <legoktm@member.fsf.org>
Tue, 6 Feb 2018 22:25:07 +0000 (14:25 -0800)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 2 May 2018 02:56:13 +0000 (19:56 -0700)
And rework LogFormatterTest so it doesn't need to access that property.

Change-Id: I4d429430efe74dc083019a1a8bb07257785484b9

includes/logging/LogFormatter.php
tests/phpunit/includes/logging/LogFormatterTest.php

index bc0491f..0ffe691 100644 (file)
@@ -108,6 +108,12 @@ class LogFormatter {
         */
        private $linkRenderer;
 
+       /**
+        * @see LogFormatter::getMessageParameters
+        * @var array
+        */
+       protected $parsedParameters;
+
        protected function __construct( LogEntry $entry ) {
                $this->entry = $entry;
                $this->context = RequestContext::getMain();
index e523a31..91ce9ea 100644 (file)
@@ -91,10 +91,11 @@ class LogFormatterTest extends MediaWikiLangTestCase {
 
                $formatter->setShowUserToolLinks( false );
                $paramsWithoutTools = $formatter->getMessageParametersForTesting();
-               unset( $formatter->parsedParameters );
 
-               $formatter->setShowUserToolLinks( true );
-               $paramsWithTools = $formatter->getMessageParametersForTesting();
+               $formatter2 = LogFormatter::newFromEntry( $entry );
+               $formatter2->setContext( $this->context );
+               $formatter2->setShowUserToolLinks( true );
+               $paramsWithTools = $formatter2->getMessageParametersForTesting();
 
                $userLink = Linker::userLink(
                        $this->user->getId(),