private function unsetClassInstances() { foreach ($this->mockedClasses as $className) { F::unsetInstance($className); } $this->mockedClasses = array(); }
public static function tearDownAfterClass() { F::unsetInstance('User'); F::unsetInstance('WebRequest'); F::unsetInstance('Title'); global $wgTitle; unset($wgTitle); }
public function testAddToStack() { F::unsetInstance('JSSnippets'); $instance = F::build('JSSnippets'); $snippet = $instance->addToStack(array('/extensions/wikia/Feature/js/Feature.js', '/extensions/wikia/Feature/css/Feature.css')); $this->assertEquals('<script>JSSnippetsStack.push({dependencies:["/extensions/wikia/Feature/js/Feature.js","/extensions/wikia/Feature/css/Feature.css"]})</script>', $snippet); $snippet = $instance->addToStack(array('/extensions/wikia/Feature/js/Feature.js'), array('$.loadJQueryUI'), 'Feature.init', array('foo' => 'bar')); $this->assertEquals('<script>JSSnippetsStack.push({dependencies:["/extensions/wikia/Feature/js/Feature.js"],getLoaders:function(){return [$.loadJQueryUI]},callback:function(json){Feature.init(json)},id:"Feature.init",options:{"foo":"bar"}})</script>', $snippet); }
protected function setUpRequest($params = array()) { F::unsetInstance('WebRequest'); $wgRequest = F::build('WebRequest', $params); foreach ($params as $key => $value) { $wgRequest->setVal($key, $value); } $this->mockGlobalVariable('wgRequest', $wgRequest); }
public function testImageReviewSpecialControllerIndexError() { $this->setStubsForImageReviewSpecialControllerTests(true); $this->mockApp(); $response = $this->app->sendRequest('ImageReviewSpecialController', 'index', array()); $imagesList = $response->getVal('imageList'); $this->assertInternalType('array', $imagesList); $this->assertEquals($this->fakeWrongImages, $imagesList); F::unsetInstance('SpecialPage'); F::unsetInstance('ImageReviewHelper'); F::unsetInstance('ImageReviewSpecialController'); }
protected function tearDown() { global $wgCityId; $wgCityId = $this->wgCityId; F::unsetInstance('FounderProgressBarController'); }
public function tearDown() { F::unsetInstance('GlobalTitle'); F::unsetInstance('ScavengerHuntGames'); }
protected function tearDownToggleFeature() { global $wgWikicitiesReadOnly; $wgWikicitiesReadOnly = $this->wgWikicitiesReadOnly_org; F::unsetInstance('LogPage'); }
protected function tearDownGetStatsMock() { F::unsetInstance('QuickStatsController'); }
protected function tearDown() { F::unsetInstance('Category'); }