HomePhabricator

phpunit: Set FauxRequest(proto) and wgServer explicitly (avoid global state)

Authored by Krinkle on Aug 6 2019, 1:12 PM.

Description

phpunit: Set FauxRequest(proto) and wgServer explicitly (avoid global state)

Avoid relying on unmocked state of the $wgRequest global object (via PROTO_CURRENT),
and $wgServer (via wfGetServerUrl).

Instead, set the FauxRequest protocol explicitly, mock $wgServer, and assert
the result explicitly.

This is possible since 9d225ee60 and 7929d190b in MediaWiki core.

Change-Id: Ie196a60250b0f5c81cea87d8eb0f2f05437eb0aa