MediaWiki  REL1_31
autoload.ide.php File Reference

This file is PHPUnit autoload file for PhpStorm IDE and other JetBrains IDEs. More...

Go to the source code of this file.


global $argv
 $argv [1] = '--wiki'
 $argv [2] = getenv( 'WIKI_NAME' ) ?: 'wiki'
global $IP
 $maintenance = new PHPUnitMaintClass()
 $self = $maintenance->getName()
 $wgProfiler = []
foreach(array_keys( $GLOBALS) as $varName) if(is_readable("$IP/vendor/autoload.php")) if(defined( 'MW_CONFIG_CALLBACK')) else
 if (file_exists("$IP/StartProfiler.php"))

Detailed Description

This file is PHPUnit autoload file for PhpStorm IDE and other JetBrains IDEs.

This file should be set in Languages and frameworks > PHP > PhpUnit select Use Composer autoloader and set Path to script to <path to this file>. After that, tests can be run in PhpStorm using Right-click > Run or Ctrl + Shift + F10. Also, tests can be run with debugger very easily.

This file basically does almost the same thing as tests/phpunit/phpunit.php, except that all code is going to be executed inside some function, so some hacks needed to make old code to be executed as if it was executed on top of the execution stack.

PS: Mostly it is copy-paste from phpunit.php and doMaintenance.php.

Definition in file autoload.ide.php.

Variable Documentation

◆ $argv [1/3]

◆ $argv [2/3]

$argv[1] = '--wiki'

Definition at line 25 of file autoload.ide.php.

◆ $argv [3/3]

$argv[2] = getenv( 'WIKI_NAME' ) ?: 'wiki'

Definition at line 26 of file autoload.ide.php.

◆ $IP

Definition at line 40 of file autoload.ide.php.

◆ $maintenance

$maintenance = new PHPUnitMaintClass()

Definition at line 32 of file autoload.ide.php.

◆ $requireOnceGlobalsScope

Initial value:
= function ( $file ) use ( $self ) {
foreach ( array_keys( $GLOBALS ) as $varName ) {
eval( sprintf( 'global $%s;', $varName ) );
require_once $file;
unset( $file );
$definedVars = get_defined_vars();
foreach ( $definedVars as $varName => $value ) {
eval( sprintf( 'global $%s; $%s = $value;', $varName, $varName ) );

Definition at line 49 of file autoload.ide.php.

◆ $self

$self = $maintenance->getName()

Definition at line 39 of file autoload.ide.php.

◆ $wgProfiler

$wgProfiler = []

Definition at line 42 of file autoload.ide.php.

◆ else

foreach (array_keys($GLOBALS) as $varName) if (is_readable("$IP/vendor/autoload.php")) if (defined('MW_CONFIG_CALLBACK')) else
Initial value:
require $maintenance->loadSettings()

Definition at line 80 of file autoload.ide.php.

◆ if


Definition at line 43 of file autoload.ide.php.

Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
Definition: APACHE-LICENSE-2.0.txt:10
Definition: autoload.ide.php:32
Definition: autoload.ide.php:39
Definition: styleTest.css.php:45
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:22
Definition: ComposerHookHandler.php:6