BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages

Sets a global, maintaining a stashed version of the previous global to be restored in tearDown

The 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$pairsKey to the global variable, or an array of key/value pairs.
mixed$valueValue to set the global to (ignored if an array is given as first argument).