From: Kunal Mehta Date: Tue, 6 Feb 2018 22:25:07 +0000 (-0800) Subject: Declare LogFormatter::$parsedParameters property X-Git-Tag: 1.34.0-rc.0~5558 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;ds=sidebyside;h=6066f6c063af9622b005218976ed018b36254e42;p=lhc%2Fweb%2Fwiklou.git Declare LogFormatter::$parsedParameters property And rework LogFormatterTest so it doesn't need to access that property. Change-Id: I4d429430efe74dc083019a1a8bb07257785484b9 --- diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index bc0491f4cf..0ffe691d65 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -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(); diff --git a/tests/phpunit/includes/logging/LogFormatterTest.php b/tests/phpunit/includes/logging/LogFormatterTest.php index e523a31e81..91ce9ea6c8 100644 --- a/tests/phpunit/includes/logging/LogFormatterTest.php +++ b/tests/phpunit/includes/logging/LogFormatterTest.php @@ -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(),