Think you might need to review how you define a "test component" That hook was added in 2011, That particular file was auto created in April of this year as (guessing here) part of a cleanup/code refactoring. Just because it has the word test doesnt make it a unit test or similar. In this case mediawiki is testing if an extension wants to abort/modify a redirect request before its completed. Taking such a narrow, heavy handed approach as you are is a BAD THING™. The standard mediawiki release tarballs are designed for a production environment and are fairly secure as is. Blindly deleting source files based on file names is a fast way to crash a server. Mediawiki is run on several of the highest profile websites, which use that code to create the releases....

On Tue, Dec 15, 2020 at 8:42 PM Jeffrey Walton <noloader@gmail.com> wrote:
On Tue, Dec 15, 2020 at 7:57 PM Jeffrey Walton <noloader@gmail.com> wrote:
>
> On Tue, Dec 15, 2020 at 7:27 PM John <phoenixoverride@gmail.com> wrote:
> >
> > there should be a file located at /includes/Hook/TestCanonicalRedirectHook.php
> >
> > https://github.com/wikimedia/mediawiki/blob/master/includes/Hook/TestCanonicalRedirectHook.php
>
> Perfect, thank you very much.

John, I have to ask...

Why was it not called RegisterCanonicalRedirect? Where did Test come from?

/**
* This is a hook handler interface, see docs/Hooks.md.
* Use the hook name "TestCanonicalRedirect" to register handlers
implementing this interface.
*
* @stable to implement
* @ingroup Hooks
*/

Based on the comment, it seems like a better name and it avoids
masquerading as a Test component.

Jeff