aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2024-07-14 22:54:38 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2025-02-13 02:30:56 +0000
commit8fc35bd4da93c837c9d0788f234b6d43c08b740a (patch)
tree28e49549b18f577472237a92a80f6df02bb3b634
parentaba1ca4cc7d25193f059f23ed4f32c1c5715db27 (diff)
downloadmediawikicore-8fc35bd4da93c837c9d0788f234b6d43c08b740a.tar.gz
mediawikicore-8fc35bd4da93c837c9d0788f234b6d43c08b740a.zip
logging: Use LinkTarget in LogFormatter::getPreloadTitles overrides
Also avoid null as array item, as that is not allowed according to the return type Change-Id: I4083c55a69d6186448a13f35f18d96bfe9ffd23c
-rw-r--r--docs/config-schema.yaml26
-rw-r--r--includes/MainConfigSchema.php96
-rw-r--r--includes/SetupDynamicConfig.php35
-rw-r--r--includes/config-schema.php96
-rw-r--r--includes/logging/BlockLogFormatter.php23
-rw-r--r--includes/logging/MergeLogFormatter.php18
-rw-r--r--includes/logging/MoveLogFormatter.php19
-rw-r--r--includes/logging/NewUsersLogFormatter.php14
-rw-r--r--includes/logging/ProtectLogFormatter.php17
-rw-r--r--includes/logging/RenameuserLogFormatter.php12
-rw-r--r--tests/phpunit/includes/logging/NewUsersLogFormatterTest.php35
-rw-r--r--tests/phpunit/unit/includes/SetupDynamicConfigTest.php10
12 files changed, 336 insertions, 65 deletions
diff --git a/docs/config-schema.yaml b/docs/config-schema.yaml
index 6d8a6e2568a1..fa68e86519ac 100644
--- a/docs/config-schema.yaml
+++ b/docs/config-schema.yaml
@@ -7500,9 +7500,9 @@ config-schema:
Extensions with custom log types may add to this array.
LogActionsHandlers:
default:
- block/block: BlockLogFormatter
- block/reblock: BlockLogFormatter
- block/unblock: BlockLogFormatter
+ block/block: { class: BlockLogFormatter, services: [TitleParser, NamespaceInfo] }
+ block/reblock: { class: BlockLogFormatter, services: [TitleParser, NamespaceInfo] }
+ block/unblock: { class: BlockLogFormatter, services: [TitleParser, NamespaceInfo] }
contentmodel/change: ContentModelLogFormatter
contentmodel/new: ContentModelLogFormatter
delete/delete: DeleteLogFormatter
@@ -7520,22 +7520,22 @@ config-schema:
managetags/create: LogFormatter
managetags/deactivate: LogFormatter
managetags/delete: LogFormatter
- merge/merge: MergeLogFormatter
- move/move: MoveLogFormatter
- move/move_redir: MoveLogFormatter
+ merge/merge: { class: MergeLogFormatter, services: [TitleParser] }
+ move/move: { class: MoveLogFormatter, services: [TitleParser] }
+ move/move_redir: { class: MoveLogFormatter, services: [TitleParser] }
patrol/patrol: PatrolLogFormatter
patrol/autopatrol: PatrolLogFormatter
- protect/modify: ProtectLogFormatter
- protect/move_prot: ProtectLogFormatter
- protect/protect: ProtectLogFormatter
- protect/unprotect: ProtectLogFormatter
- renameuser/renameuser: RenameuserLogFormatter
+ protect/modify: { class: ProtectLogFormatter, services: [TitleParser] }
+ protect/move_prot: { class: ProtectLogFormatter, services: [TitleParser] }
+ protect/protect: { class: ProtectLogFormatter, services: [TitleParser] }
+ protect/unprotect: { class: ProtectLogFormatter, services: [TitleParser] }
+ renameuser/renameuser: { class: RenameuserLogFormatter, services: [TitleParser] }
rights/autopromote: RightsLogFormatter
rights/rights: RightsLogFormatter
- suppress/block: BlockLogFormatter
+ suppress/block: { class: BlockLogFormatter, services: [TitleParser, NamespaceInfo] }
suppress/delete: DeleteLogFormatter
suppress/event: DeleteLogFormatter
- suppress/reblock: BlockLogFormatter
+ suppress/reblock: { class: BlockLogFormatter, services: [TitleParser, NamespaceInfo] }
suppress/revision: DeleteLogFormatter
tag/update: TagLogFormatter
upload/overwrite: UploadLogFormatter
diff --git a/includes/MainConfigSchema.php b/includes/MainConfigSchema.php
index 74d818291416..a67b1218c52c 100644
--- a/includes/MainConfigSchema.php
+++ b/includes/MainConfigSchema.php
@@ -11972,9 +11972,27 @@ class MainConfigSchema {
*/
public const LogActionsHandlers = [
'default' => [
- 'block/block' => BlockLogFormatter::class,
- 'block/reblock' => BlockLogFormatter::class,
- 'block/unblock' => BlockLogFormatter::class,
+ 'block/block' => [
+ 'class' => BlockLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ]
+ ],
+ 'block/reblock' => [
+ 'class' => BlockLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ]
+ ],
+ 'block/unblock' => [
+ 'class' => BlockLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ]
+ ],
'contentmodel/change' => ContentModelLogFormatter::class,
'contentmodel/new' => ContentModelLogFormatter::class,
'delete/delete' => DeleteLogFormatter::class,
@@ -11992,22 +12010,74 @@ class MainConfigSchema {
'managetags/create' => LogFormatter::class,
'managetags/deactivate' => LogFormatter::class,
'managetags/delete' => LogFormatter::class,
- 'merge/merge' => MergeLogFormatter::class,
- 'move/move' => MoveLogFormatter::class,
- 'move/move_redir' => MoveLogFormatter::class,
+ 'merge/merge' => [
+ 'class' => MergeLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ ]
+ ],
+ 'move/move' => [
+ 'class' => MoveLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ ]
+ ],
+ 'move/move_redir' => [
+ 'class' => MoveLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ ]
+ ],
'patrol/patrol' => PatrolLogFormatter::class,
'patrol/autopatrol' => PatrolLogFormatter::class,
- 'protect/modify' => ProtectLogFormatter::class,
- 'protect/move_prot' => ProtectLogFormatter::class,
- 'protect/protect' => ProtectLogFormatter::class,
- 'protect/unprotect' => ProtectLogFormatter::class,
- 'renameuser/renameuser' => RenameuserLogFormatter::class,
+ 'protect/modify' => [
+ 'class' => ProtectLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ ]
+ ],
+ 'protect/move_prot' => [
+ 'class' => ProtectLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ ]
+ ],
+ 'protect/protect' => [
+ 'class' => ProtectLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ ]
+ ],
+ 'protect/unprotect' => [
+ 'class' => ProtectLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ ]
+ ],
+ 'renameuser/renameuser' => [
+ 'class' => RenameuserLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ ]
+ ],
'rights/autopromote' => RightsLogFormatter::class,
'rights/rights' => RightsLogFormatter::class,
- 'suppress/block' => BlockLogFormatter::class,
+ 'suppress/block' => [
+ 'class' => BlockLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ]
+ ],
'suppress/delete' => DeleteLogFormatter::class,
'suppress/event' => DeleteLogFormatter::class,
- 'suppress/reblock' => BlockLogFormatter::class,
+ 'suppress/reblock' => [
+ 'class' => BlockLogFormatter::class,
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ]
+ ],
'suppress/revision' => DeleteLogFormatter::class,
'tag/update' => TagLogFormatter::class,
'upload/overwrite' => UploadLogFormatter::class,
diff --git a/includes/SetupDynamicConfig.php b/includes/SetupDynamicConfig.php
index f802c4567e72..f6c0a4508cff 100644
--- a/includes/SetupDynamicConfig.php
+++ b/includes/SetupDynamicConfig.php
@@ -321,11 +321,36 @@ if ( $wgNewUserLog ) {
$wgLogTypes[] = 'newusers';
$wgLogNames['newusers'] = 'newuserlogpage';
$wgLogHeaders['newusers'] = 'newuserlogpagetext';
- $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class;
- $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class;
- $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class;
- $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class;
- $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class;
+ $wgLogActionsHandlers['newusers/newusers'] = [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ];
+ $wgLogActionsHandlers['newusers/create'] = [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ];
+ $wgLogActionsHandlers['newusers/create2'] = [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ];
+ $wgLogActionsHandlers['newusers/byemail'] = [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ];
+ $wgLogActionsHandlers['newusers/autocreate'] = [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ];
}
if ( $wgPageCreationLog ) {
diff --git a/includes/config-schema.php b/includes/config-schema.php
index 686ef282886a..547e5cf582c5 100644
--- a/includes/config-schema.php
+++ b/includes/config-schema.php
@@ -2263,9 +2263,27 @@ return [
'LogActions' => [
],
'LogActionsHandlers' => [
- 'block/block' => 'BlockLogFormatter',
- 'block/reblock' => 'BlockLogFormatter',
- 'block/unblock' => 'BlockLogFormatter',
+ 'block/block' => [
+ 'class' => 'BlockLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ],
+ ],
+ 'block/reblock' => [
+ 'class' => 'BlockLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ],
+ ],
+ 'block/unblock' => [
+ 'class' => 'BlockLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ],
+ ],
'contentmodel/change' => 'ContentModelLogFormatter',
'contentmodel/new' => 'ContentModelLogFormatter',
'delete/delete' => 'DeleteLogFormatter',
@@ -2283,22 +2301,74 @@ return [
'managetags/create' => 'LogFormatter',
'managetags/deactivate' => 'LogFormatter',
'managetags/delete' => 'LogFormatter',
- 'merge/merge' => 'MergeLogFormatter',
- 'move/move' => 'MoveLogFormatter',
- 'move/move_redir' => 'MoveLogFormatter',
+ 'merge/merge' => [
+ 'class' => 'MergeLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ ],
+ ],
+ 'move/move' => [
+ 'class' => 'MoveLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ ],
+ ],
+ 'move/move_redir' => [
+ 'class' => 'MoveLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ ],
+ ],
'patrol/patrol' => 'PatrolLogFormatter',
'patrol/autopatrol' => 'PatrolLogFormatter',
- 'protect/modify' => 'ProtectLogFormatter',
- 'protect/move_prot' => 'ProtectLogFormatter',
- 'protect/protect' => 'ProtectLogFormatter',
- 'protect/unprotect' => 'ProtectLogFormatter',
- 'renameuser/renameuser' => 'RenameuserLogFormatter',
+ 'protect/modify' => [
+ 'class' => 'ProtectLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ ],
+ ],
+ 'protect/move_prot' => [
+ 'class' => 'ProtectLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ ],
+ ],
+ 'protect/protect' => [
+ 'class' => 'ProtectLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ ],
+ ],
+ 'protect/unprotect' => [
+ 'class' => 'ProtectLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ ],
+ ],
+ 'renameuser/renameuser' => [
+ 'class' => 'RenameuserLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ ],
+ ],
'rights/autopromote' => 'RightsLogFormatter',
'rights/rights' => 'RightsLogFormatter',
- 'suppress/block' => 'BlockLogFormatter',
+ 'suppress/block' => [
+ 'class' => 'BlockLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ],
+ ],
'suppress/delete' => 'DeleteLogFormatter',
'suppress/event' => 'DeleteLogFormatter',
- 'suppress/reblock' => 'BlockLogFormatter',
+ 'suppress/reblock' => [
+ 'class' => 'BlockLogFormatter',
+ 'services' => [
+ 'TitleParser',
+ 'NamespaceInfo',
+ ],
+ ],
'suppress/revision' => 'DeleteLogFormatter',
'tag/update' => 'TagLogFormatter',
'upload/overwrite' => 'UploadLogFormatter',
diff --git a/includes/logging/BlockLogFormatter.php b/includes/logging/BlockLogFormatter.php
index 2bcdcb92115f..fef24be56fc5 100644
--- a/includes/logging/BlockLogFormatter.php
+++ b/includes/logging/BlockLogFormatter.php
@@ -28,7 +28,10 @@ use MediaWiki\Linker\Linker;
use MediaWiki\MainConfigNames;
use MediaWiki\Message\Message;
use MediaWiki\SpecialPage\SpecialPage;
+use MediaWiki\Title\MalformedTitleException;
+use MediaWiki\Title\NamespaceInfo;
use MediaWiki\Title\Title;
+use MediaWiki\Title\TitleParser;
use MediaWiki\User\User;
/**
@@ -37,6 +40,19 @@ use MediaWiki\User\User;
* @since 1.25
*/
class BlockLogFormatter extends LogFormatter {
+ private TitleParser $titleParser;
+ private NamespaceInfo $namespaceInfo;
+
+ public function __construct(
+ LogEntry $entry,
+ TitleParser $titleParser,
+ NamespaceInfo $namespaceInfo
+ ) {
+ parent::__construct( $entry );
+ $this->titleParser = $titleParser;
+ $this->namespaceInfo = $namespaceInfo;
+ }
+
protected function getMessageParameters() {
$params = parent::getMessageParameters();
@@ -165,13 +181,16 @@ class BlockLogFormatter extends LogFormatter {
$preload = [];
// Preload user page for non-autoblocks
if ( substr( $title->getText(), 0, 1 ) !== '#' && $title->canExist() ) {
- $preload[] = $title->getTalkPage();
+ $preload[] = $this->namespaceInfo->getTalkPage( $title );
}
// Preload page restriction
$params = $this->extractParameters();
if ( isset( $params[6]['pages'] ) ) {
foreach ( $params[6]['pages'] as $page ) {
- $preload[] = Title::newFromText( $page );
+ try {
+ $preload[] = $this->titleParser->parseTitle( $page );
+ } catch ( MalformedTitleException $_ ) {
+ }
}
}
return $preload;
diff --git a/includes/logging/MergeLogFormatter.php b/includes/logging/MergeLogFormatter.php
index 65f313acf93b..40486649febe 100644
--- a/includes/logging/MergeLogFormatter.php
+++ b/includes/logging/MergeLogFormatter.php
@@ -24,7 +24,9 @@
use MediaWiki\Message\Message;
use MediaWiki\SpecialPage\SpecialPage;
+use MediaWiki\Title\MalformedTitleException;
use MediaWiki\Title\Title;
+use MediaWiki\Title\TitleParser;
/**
* This class formats merge log entries.
@@ -32,10 +34,24 @@ use MediaWiki\Title\Title;
* @since 1.25
*/
class MergeLogFormatter extends LogFormatter {
+ private TitleParser $titleParser;
+
+ public function __construct(
+ LogEntry $entry,
+ TitleParser $titleParser
+ ) {
+ parent::__construct( $entry );
+ $this->titleParser = $titleParser;
+ }
+
public function getPreloadTitles() {
$params = $this->extractParameters();
- return [ Title::newFromText( $params[3] ) ];
+ try {
+ return [ $this->titleParser->parseTitle( $params[3] ) ];
+ } catch ( MalformedTitleException $_ ) {
+ }
+ return [];
}
protected function getMessageParameters() {
diff --git a/includes/logging/MoveLogFormatter.php b/includes/logging/MoveLogFormatter.php
index 71e44337b634..2b24df11e519 100644
--- a/includes/logging/MoveLogFormatter.php
+++ b/includes/logging/MoveLogFormatter.php
@@ -25,7 +25,9 @@
use MediaWiki\Message\Message;
use MediaWiki\SpecialPage\SpecialPage;
+use MediaWiki\Title\MalformedTitleException;
use MediaWiki\Title\Title;
+use MediaWiki\Title\TitleParser;
/**
* This class formats move log entries.
@@ -33,13 +35,22 @@ use MediaWiki\Title\Title;
* @since 1.19
*/
class MoveLogFormatter extends LogFormatter {
+ private TitleParser $titleParser;
+
+ public function __construct(
+ LogEntry $entry,
+ TitleParser $titleParser
+ ) {
+ parent::__construct( $entry );
+ $this->titleParser = $titleParser;
+ }
+
public function getPreloadTitles() {
$params = $this->extractParameters();
- $title = Title::newFromText( $params[3] );
- if ( $title !== null ) {
- return [ $title ];
- } else {
+ try {
+ return [ $this->titleParser->parseTitle( $params[3] ) ];
+ } catch ( MalformedTitleException $_ ) {
// namespace configuration may have changed to make $params[3] invalid (T370396);
// nothing to preload in this case
return [];
diff --git a/includes/logging/NewUsersLogFormatter.php b/includes/logging/NewUsersLogFormatter.php
index ec640e77a696..306fa6b30304 100644
--- a/includes/logging/NewUsersLogFormatter.php
+++ b/includes/logging/NewUsersLogFormatter.php
@@ -24,7 +24,7 @@
*/
use MediaWiki\Message\Message;
-use MediaWiki\Title\Title;
+use MediaWiki\Title\NamespaceInfo;
use MediaWiki\User\User;
/**
@@ -33,6 +33,16 @@ use MediaWiki\User\User;
* @since 1.19
*/
class NewUsersLogFormatter extends LogFormatter {
+ private NamespaceInfo $namespaceInfo;
+
+ public function __construct(
+ LogEntry $entry,
+ NamespaceInfo $namespaceInfo
+ ) {
+ parent::__construct( $entry );
+ $this->namespaceInfo = $namespaceInfo;
+ }
+
protected function getMessageParameters() {
$params = parent::getMessageParameters();
$subtype = $this->entry->getSubtype();
@@ -64,7 +74,7 @@ class NewUsersLogFormatter extends LogFormatter {
$subtype = $this->entry->getSubtype();
if ( $subtype === 'create2' || $subtype === 'byemail' ) {
// add the user talk to LinkBatch for the userLink
- return [ Title::makeTitle( NS_USER_TALK, $this->entry->getTarget()->getText() ) ];
+ return [ $this->namespaceInfo->getTalkPage( $this->entry->getTarget() ) ];
}
return [];
diff --git a/includes/logging/ProtectLogFormatter.php b/includes/logging/ProtectLogFormatter.php
index aa71fafc265d..8680e6d41b22 100644
--- a/includes/logging/ProtectLogFormatter.php
+++ b/includes/logging/ProtectLogFormatter.php
@@ -23,7 +23,9 @@
*/
use MediaWiki\Message\Message;
+use MediaWiki\Title\MalformedTitleException;
use MediaWiki\Title\Title;
+use MediaWiki\Title\TitleParser;
/**
* This class formats protect log entries.
@@ -31,11 +33,24 @@ use MediaWiki\Title\Title;
* @since 1.26
*/
class ProtectLogFormatter extends LogFormatter {
+ private TitleParser $titleParser;
+
+ public function __construct(
+ LogEntry $entry,
+ TitleParser $titleParser
+ ) {
+ parent::__construct( $entry );
+ $this->titleParser = $titleParser;
+ }
+
public function getPreloadTitles() {
$subtype = $this->entry->getSubtype();
if ( $subtype === 'move_prot' ) {
$params = $this->extractParameters();
- return [ Title::newFromText( $params[3] ) ];
+ try {
+ return [ $this->titleParser->parseTitle( $params[3] ) ];
+ } catch ( MalformedTitleException $_ ) {
+ }
}
return [];
}
diff --git a/includes/logging/RenameuserLogFormatter.php b/includes/logging/RenameuserLogFormatter.php
index abc965b24e45..09c1e508f075 100644
--- a/includes/logging/RenameuserLogFormatter.php
+++ b/includes/logging/RenameuserLogFormatter.php
@@ -2,11 +2,21 @@
use MediaWiki\Message\Message;
use MediaWiki\Title\Title;
+use MediaWiki\Title\TitleParser;
/**
* LogFormatter for renameuser/renameuser logs
*/
class RenameuserLogFormatter extends LogFormatter {
+ private TitleParser $titleParser;
+
+ public function __construct(
+ LogEntry $entry,
+ TitleParser $titleParser
+ ) {
+ parent::__construct( $entry );
+ $this->titleParser = $titleParser;
+ }
/**
* @inheritDoc
@@ -115,7 +125,7 @@ class RenameuserLogFormatter extends LogFormatter {
$newUserName = $params[4];
}
- $title = Title::makeTitleSafe( NS_USER, $newUserName );
+ $title = $this->titleParser->makeTitleValueSafe( NS_USER, $newUserName );
if ( $title ) {
return [ $title ];
}
diff --git a/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php b/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php
index 4f85a5b6d11c..60bd6f9244c2 100644
--- a/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php
+++ b/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php
@@ -11,11 +11,36 @@ class NewUsersLogFormatterTest extends LogFormatterTestCase {
// Register LogHandler, see $wgNewUserLog in Setup.php
$this->mergeMwGlobalArrayValue( 'wgLogActionsHandlers', [
- 'newusers/newusers' => NewUsersLogFormatter::class,
- 'newusers/create' => NewUsersLogFormatter::class,
- 'newusers/create2' => NewUsersLogFormatter::class,
- 'newusers/byemail' => NewUsersLogFormatter::class,
- 'newusers/autocreate' => NewUsersLogFormatter::class,
+ 'newusers/newusers' => [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ],
+ 'newusers/create' => [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ],
+ 'newusers/create2' => [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ],
+ 'newusers/byemail' => [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ],
+ 'newusers/autocreate' => [
+ 'class' => NewUsersLogFormatter::class,
+ 'services' => [
+ 'NamespaceInfo',
+ ]
+ ],
] );
}
diff --git a/tests/phpunit/unit/includes/SetupDynamicConfigTest.php b/tests/phpunit/unit/includes/SetupDynamicConfigTest.php
index d00feddd73fb..ccdddbbf812e 100644
--- a/tests/phpunit/unit/includes/SetupDynamicConfigTest.php
+++ b/tests/phpunit/unit/includes/SetupDynamicConfigTest.php
@@ -763,15 +763,15 @@ class SetupDynamicConfigTest extends MediaWikiUnitTestCase {
$testObj->assertSame( 'newuserlogpage', $vars[MainConfigNames::LogNames]['newusers'] );
$testObj->assertSame( 'newuserlogpagetext', $vars[MainConfigNames::LogHeaders]['newusers'] );
$testObj->assertSame( NewUsersLogFormatter::class,
- $vars[MainConfigNames::LogActionsHandlers]['newusers/newusers'] );
+ $vars[MainConfigNames::LogActionsHandlers]['newusers/newusers']['class'] );
$testObj->assertSame( NewUsersLogFormatter::class,
- $vars[MainConfigNames::LogActionsHandlers]['newusers/create'] );
+ $vars[MainConfigNames::LogActionsHandlers]['newusers/create']['class'] );
$testObj->assertSame( NewUsersLogFormatter::class,
- $vars[MainConfigNames::LogActionsHandlers]['newusers/create2'] );
+ $vars[MainConfigNames::LogActionsHandlers]['newusers/create2']['class'] );
$testObj->assertSame( NewUsersLogFormatter::class,
- $vars[MainConfigNames::LogActionsHandlers]['newusers/byemail'] );
+ $vars[MainConfigNames::LogActionsHandlers]['newusers/byemail']['class'] );
$testObj->assertSame( NewUsersLogFormatter::class,
- $vars[MainConfigNames::LogActionsHandlers]['newusers/autocreate'] );
+ $vars[MainConfigNames::LogActionsHandlers]['newusers/autocreate']['class'] );
return $expectedDefault;
},