Merge "AbuseFilterExtensionJsonTest: Allow skipping other extension hooks"

This commit is contained in:
jenkins-bot 2024-07-29 12:52:29 +00:00 committed by Gerrit Code Review
commit b0771ea6ca

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 ];
}
}
}