MediaWiki
1.28.1
|
Sets a global, maintaining a stashed version of the previous global to be restored in tearDownThe key is added to the array of globals that will be reset afterwards in the tearDown().
protected function setUp() { $this->setMwGlobals( 'wgRestrictStuff', true ); }
function testFoo() {}
function testBar() {} $this->assertTrue( self::getX()->doStuff() );
$this->setMwGlobals( 'wgRestrictStuff', false ); $this->assertTrue( self::getX()->doStuff() ); }
function testQuux() {}
array | string | $pairs | Key to the global variable, or an array of key/value pairs. |
mixed | $value | Value to set the global to (ignored if an array is given as first argument). |