AbuseFilterExtensionJsonTest: Allow skipping other extension hooks

Change-Id: I1146cec2b27c964f5ed07e7da76fc7b9ec4a09c5
This commit is contained in:
Bartosz Dziewoński 2024-07-28 16:42:52 +02:00
parent 841214ab43
commit 1c0ab3010a

View file

@ -16,11 +16,12 @@ class AbuseFilterExtensionJsonTest extends ExtensionJsonTestBase {
protected string $extensionJsonPath = __DIR__ . '/../../../extension.json';
public function provideHookHandlerNames(): iterable {
foreach ( $this->getExtensionJson()['HookHandlers'] ?? [] as $hookHandlerName => $specification ) {
if ( $hookHandlerName === 'UserMerge' && !ExtensionRegistry::getInstance()->isLoaded( 'UserMerge' ) ) {
$extHookHandlers = [ 'CheckUser', 'ConfirmEdit', 'Echo', 'UserMerge' ];
foreach ( $this->getExtensionJson()['HookHandlers'] ?? [] as $name => $specification ) {
if ( in_array( $name, $extHookHandlers ) && !ExtensionRegistry::getInstance()->isLoaded( $name ) ) {
continue;
}
yield [ $hookHandlerName ];
yield [ $name ];
}
}
}