From 1c0ab3010aad4d0781bb4cd2cace82ad7ee29ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sun, 28 Jul 2024 16:42:52 +0200 Subject: [PATCH] AbuseFilterExtensionJsonTest: Allow skipping other extension hooks Change-Id: I1146cec2b27c964f5ed07e7da76fc7b9ec4a09c5 --- tests/phpunit/integration/AbuseFilterExtensionJsonTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/integration/AbuseFilterExtensionJsonTest.php b/tests/phpunit/integration/AbuseFilterExtensionJsonTest.php index d2f80fb5f..f0f44d6d5 100644 --- a/tests/phpunit/integration/AbuseFilterExtensionJsonTest.php +++ b/tests/phpunit/integration/AbuseFilterExtensionJsonTest.php @@ -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 ]; } } }