4 * @covers MediaWikiTestCase
5 * @author Adam Shorland
7 class MediaWikiTestCaseTest
extends MediaWikiTestCase
{
9 const GLOBAL_KEY_EXISTING
= 'MediaWikiTestCaseTestGLOBAL-Existing';
11 public static function setUpBeforeClass() {
12 parent
::setUpBeforeClass();
13 $GLOBALS[self
::GLOBAL_KEY_EXISTING
] = 'foo';
16 public static function tearDownAfterClass() {
17 parent
::tearDownAfterClass();
18 unset( $GLOBALS[self
::GLOBAL_KEY_EXISTING
] );
22 * @covers MediaWikiTestCase::setMwGlobals
23 * @covers MediaWikiTestCase::tearDown
25 public function testSetGlobalsAreRestoredOnTearDown() {
26 $this->setMwGlobals( self
::GLOBAL_KEY_EXISTING
, 'bar' );
29 $GLOBALS[self
::GLOBAL_KEY_EXISTING
],
30 'Global failed to correctly set'
37 $GLOBALS[self
::GLOBAL_KEY_EXISTING
],
38 'Global failed to be restored on tearDown'
43 * @covers MediaWikiTestCase::stashMwGlobals
44 * @covers MediaWikiTestCase::tearDown
46 public function testStashedGlobalsAreRestoredOnTearDown() {
47 $this->stashMwGlobals( self
::GLOBAL_KEY_EXISTING
);
48 $GLOBALS[self
::GLOBAL_KEY_EXISTING
] = 'bar';
51 $GLOBALS[self
::GLOBAL_KEY_EXISTING
],
52 'Global failed to correctly set'
59 $GLOBALS[self
::GLOBAL_KEY_EXISTING
],
60 'Global failed to be restored on tearDown'