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.

Variables

global $argv
 
 $argv [1] = '--wiki'
 
 $argv [2] = getenv( 'WIKI_NAME' ) ?: 'wiki'
 
global $IP
 
 $maintenance = new PHPUnitMaintClass()
 
 $requireOnceGlobalsScope
 
 $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

global $IP

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

◆ $maintenance

$maintenance = new PHPUnitMaintClass()

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

◆ $requireOnceGlobalsScope

$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 ) );
}
}
$GLOBALS['IP']
$self

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()
$maintenance

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

◆ if

if(file_exists("$IP/StartProfiler.php")) ( file_exists("$IP/StartProfiler.php") )

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