public function setUp()
 {
     $dir = dirname(__FILE__) . '/../../../';
     global $wgAutoloadClasses;
     $this->setupFile = $dir . 'HubRssFeed.setup.php';
     parent::setUp();
 }
Example #2
0
 function tearDown()
 {
     global $wgDevelEnvironment, $wgDevelEnvironmentName;
     $wgDevelEnvironment = $this->wgDevelEnv;
     $wgDevelEnvironmentName = $this->wgDevelEnvName;
     parent::tearDown();
 }
 public function tearDown()
 {
     global $wgApiAccess, $wgApiEnvironment;
     $wgApiAccess = $this->org_wgApiAccess;
     $wgApiEnvironment = $this->org_wgApiEnvironment;
     parent::tearDown();
 }
Example #4
0
 public function setUp()
 {
     global $IP;
     $this->setupFile = "{$IP}/extensions/wikia/JsonFormat/JsonFormat.setup.php";
     $this->mockGlobalVariable('wgTitle', Title::newFromText('TestPageDoesNotExist'));
     parent::setUp();
 }
Example #5
0
 public function setUp()
 {
     $this->setupFile = dirname(__FILE__) . '/../ShareButtons.setup.php';
     parent::setUp();
     $this->mockGlobalVariable('wgTitle', Title::newMainPage());
     $this->mockApp();
 }
 public function setUp()
 {
     $this->setupFile = __DIR__ . '/../LyricFind.setup.php';
     parent::setUp();
     // mock title and prevent DB changes
     $this->mockGlobalVariable('wgTitle', $this->mockClassWithMethods('Title', ['getArticleID' => 123]));
 }
 public function setUp()
 {
     $this->setupFile = __DIR__ . '/../AutoFollow.setup.php';
     parent::setUp();
     $this->mockGlobalVariable('wgAutoFollowFlag', 'autowatched-already');
     $this->mockGlobalVariable('wgAutoFollowLangCityIdMap', ['de' => 1779, 'en' => 177, 'es' => 3487, 'fi' => 3083, 'fr' => 10261, 'it' => 11250, 'ja' => 3439, 'nl' => 10466, 'pl' => 1686, 'pt' => 696403, 'ru' => 3321, 'uk' => 3321, 'zh' => 4079]);
 }
Example #8
0
 public function setUp()
 {
     $this->setupFile = __DIR__ . "/../AbPerformanceTesting.setup.php";
     parent::setUp();
     $this->mockGlobalVariable('wgCityId', 5123);
     $this->mockGlobalFunction('wfGetBeaconId', '8gQHS-Q4_c');
 }
 protected function setUp()
 {
     global $wgCityId;
     $this->wgCityId = $wgCityId;
     $this->setupFile = dirname(__FILE__) . '/../FounderProgressBar.setup.php';
     parent::setUp();
     // Mock response using $this->getValCallBack()
     $mockR = $this->getMock('WikiaResponse', array('getVal'), array('raw'));
     $mockR->expects($this->any())->method('getVal')->will($this->returnCallback(array($this, "getValCallback")));
     $mock_result = $this->getMock('ResultWrapper', array(), array(), '', false);
     $this->mock_db = $this->getMock('DatabaseMysql', array('select', 'query', 'update', 'commit', 'fetchObject', 'fetchRow'));
     $this->mock_db->expects($this->any())->method('select')->will($this->returnValue($mock_result));
     $this->mock_db->expects($this->any())->method('query');
     $this->mock_db->expects($this->any())->method('update');
     $this->mock_db->expects($this->any())->method('commit');
     $cache = $this->getMock('stdClass', array('get', 'set', 'delete'));
     $cache->expects($this->any())->method('get')->will($this->returnValue(null));
     $cache->expects($this->any())->method('set');
     $cache->expects($this->any())->method('delete');
     $mock = $this->getMock('FounderProgressBarController', array('sendSelfRequest', 'getDb', 'getMCache'));
     $mock->expects($this->any())->method('sendSelfRequest')->will($this->returnValue($mockR));
     $mock->expects($this->any())->method('getDb')->will($this->returnValue($this->mock_db));
     $mock->expects($this->any())->method('getMCache')->will($this->returnValue($cache));
     F::setInstance("FounderProgressBarController", $mock);
     $this->object = F::build('FounderProgressBarController');
     $this->task_id = 0;
 }
Example #10
0
 protected function setUp()
 {
     require_once dirname(__FILE__) . '/../SpecialCssHooks.class.php';
     require_once dirname(__FILE__) . '/../SpecialCssModel.class.php';
     require_once dirname(__FILE__) . '/../SpecialCssController.class.php';
     parent::setUp();
 }
 public function tearDown()
 {
     if (!empty($this->tmpFile)) {
         unlink($this->tmpFile);
     }
     parent::tearDown();
 }
Example #12
0
 public function setUp()
 {
     parent::setUp();
     global $IP;
     include_once $IP . '/includes/wikia/ui/Factory.class.php';
     $this->instance = Wikia\UI\Factory::getInstance();
 }
 public function tearDown()
 {
     parent::tearDown();
     if ($this->tmpPath !== false) {
         unlink($this->tmpPath);
     }
 }
Example #14
0
 function setUp()
 {
     parent::setUp();
     $memcMock = $this->getMock('MemcachedPhpBagOStuff', ['get', 'set'], [], '', false);
     $memcMock->expects($this->any())->method('get')->will($this->returnValue(false));
     $memcMock->expects($this->any())->method('set')->will($this->returnValue(true));
     $this->mockGlobalVariable('wgMemc', $memcMock);
 }
Example #15
0
 function setUp()
 {
     global $wgAutoloadClasses, $IP;
     $wgAutoloadClasses['UnitTestController'] = dirname(__FILE__) . '/controllers/UnitTestController.class.php';
     $wgAutoloadClasses['UnitTestService'] = dirname(__FILE__) . '/controllers/UnitTestService.class.php';
     $wgAutoloadClasses['OasisTemplate'] = $IP . '/skins/Oasis.php';
     parent::setUp();
 }
Example #16
0
 public function setUp()
 {
     $this->parser = new Parser();
     $title = Title::newFromText('test');
     $options = new ParserOptions();
     $this->parser->startExternalParse($title, $options, 'text', true);
     parent::setUp();
 }
 public function setUp()
 {
     $this->setupFile = dirname(__FILE__) . '/../CreateNewWiki_setup.php';
     parent::setUp();
     $userMock = $this->getMock('stdClass', array('getGroups'));
     $userMock->expects($this->any())->method('getGroups')->will($this->returnValue(array()));
     $this->mockGlobalVariable('wgUser', $userMock);
 }
Example #18
0
 public function setUp()
 {
     $this->setupFile = __DIR__ . '/../Helios.setup.php';
     $this->webRequestMock = $this->getMock('\\WebRequest', ['getHeader', 'getCookie'], [], '', false);
     $this->mockGlobalVariable('wgHeliosLoginSamplingRate', 100);
     $this->mockGlobalVariable('wgHeliosLoginShadowMode', false);
     User::purgeAuthenticationCache();
     parent::setUp();
 }
Example #19
0
 public function tearDown()
 {
     parent::tearDown();
     global $wgStagingList;
     $wgStagingList = $this->org_StagingList;
     if (!empty($this->serverName)) {
         $_SERVER['SERVER_NAME'] = $this->serverName;
     }
 }
Example #20
0
 function setUp()
 {
     global $wgParser;
     $this->setupFile = __DIR__ . "/../MyHome.php";
     parent::setUp();
     if (empty($wgParser->mOptions)) {
         $wgParser->Options(new ParserOptions());
     }
 }
Example #21
0
 protected function setUp()
 {
     parent::setUp();
     $this->attribs = array('align' => 'right', 'width' => 300, 'caption' => 'Foo', 'lat' => '52.406878', 'lon' => '16.922124');
     $this->model = F::build('PlaceModel', array($this->attribs), 'newFromAttributes');
     // use main page as an article for this place
     $mainPage = Title::newMainPage();
     $this->model->setPageId($mainPage->getArticleId());
 }
 public function setUp()
 {
     $this->setupFile = __DIR__ . '/../LyricFind.setup.php';
     parent::setUp();
     // mock API settings
     $this->mockGlobalVariable('wgLyricFindApiUrl', self::SERVICE_URL);
     $this->mockGlobalVariable('wgLyricFindApiKeys', ['display' => self::API_KEY]);
     // prevent DB changes
     $this->mockGlobalFunction('wfSetWikiaPageProp', null);
 }
Example #23
0
 public function setUp()
 {
     parent::setUp();
     // assume we're in production environment
     $this->mockGlobalVariable('wgDevelEnvironment', false);
     $this->mockGlobalVariable('wgDevBoxImageServerOverride', false);
     $this->mockGlobalVariable('wgEnableVignette', false);
     $this->mockGlobalVariable('wgImagesDomainSharding', 'images%s.wikia.nocookie.net');
     $this->mockGlobalVariable('wgCdnStylePath', sprintf('http://slot1.images.wikia.nocookie.net/__cb%s/common', self::DEFAULT_CB));
 }
Example #24
0
 protected function setUp()
 {
     $this->setupFile = __DIR__ . '/../Places.setup.php';
     parent::setUp();
     $this->attribs = array('align' => 'right', 'width' => 300, 'caption' => 'Foo', 'lat' => '52.406878', 'lon' => '16.922124');
     $this->model = PlaceModel::newFromAttributes($this->attribs);
     // use main page as an article for this place
     $mainPage = Title::newMainPage();
     $this->model->setPageId($mainPage->getArticleId());
 }
Example #25
0
 /**
  * Print out currently run test
  */
 public static function setUpBeforeClass()
 {
     global $wgAnnotateTestSpeed;
     error_reporting(E_ALL);
     $testClass = get_called_class();
     echo "\nRunning '{$testClass}'...";
     self::$testRunTime = microtime(true);
     self::$numberSlowTests = 0;
     if ($wgAnnotateTestSpeed) {
         WikiaTestSpeedAnnotator::initialize();
     }
 }
Example #26
0
 public function setUp()
 {
     $dir = dirname(__FILE__) . '/../../../';
     global $wgAutoloadClasses;
     $wgAutoloadClasses['EditHubModel'] = $dir . '../WikiaHubsServices/models/EditHubModel.class.php';
     $wgAutoloadClasses['WikiaHubsModuleSliderService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModuleSliderService.class.php';
     $wgAutoloadClasses['WikiaHubsModuleFromthecommunityService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModuleFromthecommunityService.class.php';
     $wgAutoloadClasses['WikiaHubsModuleWikiaspicksService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModuleWikiaspicksService.class.php';
     $wgAutoloadClasses['WikiaHubsModuleEditableService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModuleEditableService.class.php';
     $wgAutoloadClasses['WikiaHubsModuleFeaturedvideoService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModuleFeaturedvideoService.class.php';
     $wgAutoloadClasses['WikiaHubsModuleExploreService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModuleExploreService.class.php';
     $wgAutoloadClasses['WikiaHubsModulePollsService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModulePollsService.class.php';
     $wgAutoloadClasses['WikiaHubsModulePopularvideosService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModulePopularvideosService.class.php';
     $wgAutoloadClasses['WikiaHubsExploreModel'] = $dir . '../WikiaHubsServices/models/WikiaHubsExploreModel.class.php';
     $wgAutoloadClasses['WikiaHubsModuleWAMService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModuleWAMService.class.php';
     $wgAutoloadClasses['WikiaHubsModuleNonEditableService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModuleNonEditableService.class.php';
     $wgAutoloadClasses['WikiaHubsModuleService'] = $dir . '../WikiaHubsServices/modules/WikiaHubsModuleService.class.php';
     $this->setupFile = $dir . 'HubRssFeed.setup.php';
     $this->editHubModel = $this->getMockBuilder('EditHubModel')->disableOriginalConstructor();
     parent::setUp();
 }
 public function setUp()
 {
     global $IP;
     $this->setupFile = "{$IP}/extensions/wikia/WikiaMaps/WikiaMaps.setup.php";
     parent::setUp();
 }
 public function setUp()
 {
     $this->setupFile = __DIR__ . "/../imageServing.setup.php";
     parent::setUp();
 }
 protected function setUp()
 {
     require_once dirname(__FILE__) . '/../InfoboxExtractor.class.php';
     parent::setUp();
 }
Example #30
0
 public function tearDown()
 {
     global $wgDevelEnvironment;
     $wgDevelEnvironment = $this->org_wgDevelEnvironment;
     parent::tearDown();
 }