mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-27 17:01:07 +00:00
MathGenerateTests: Remove use of $wgUser
Being written to, but not read from, so shouldn't be needed anymore - set the User of the main RequestContext instead. Bug: T248550 Change-Id: I32d50e7bcd81ed77646d625e1a10b0e91e5d6c21
This commit is contained in:
parent
c2b3f74402
commit
4868d632c1
|
@ -60,13 +60,12 @@ class MathGenerateTests extends Maintenance {
|
|||
}
|
||||
|
||||
public function execute() {
|
||||
global $wgUser;
|
||||
$parserTests = [];
|
||||
$page = $this->getArg( 0, self::REFERENCE_PAGE );
|
||||
$offset = $this->getOption( 'offset', 0 );
|
||||
$length = $this->getOption( 'length', PHP_INT_MAX );
|
||||
$userName = $this->getOption( 'user', 'Maintenance script' );
|
||||
$wgUser = User::newFromName( $userName );
|
||||
RequestContext::getMain()->setUser( User::newFromName( $userName ) );
|
||||
$allEquations = self::getMathTagsFromPage( $page );
|
||||
if ( !is_array( $allEquations ) ) {
|
||||
echo "Could not get equations from page '$page'\n";
|
||||
|
|
Loading…
Reference in a new issue