Ejemplo n.º 1
0
 /**
  * @dataProvider isRTLProvider
  */
 public function testIsRTL($userRTL, $wikiRTL, $expected)
 {
     $this->mockGlobalVariable('wgContLang', $this->getLanguageMock($wikiRTL));
     $this->mockGlobalVariable('wgLang', $this->getLanguageMock($userRTL));
     $this->assertEquals($expected, SassUtil::isRTL());
 }
Ejemplo n.º 2
0
 /**
  * @desc Get Current wiki settings
  *
  * @return mixed
  */
 public function getWikiVariables()
 {
     global $wgSitename, $wgCacheBuster, $wgDBname, $wgDefaultSkin, $wgLang, $wgLanguageCode, $wgContLang, $wgCityId, $wgEnableNewAuth;
     return ['cacheBuster' => (int) $wgCacheBuster, 'dbName' => $wgDBname, 'defaultSkin' => $wgDefaultSkin, 'enableNewAuth' => $wgEnableNewAuth, 'id' => (int) $wgCityId, 'language' => ['user' => $wgLang->getCode(), 'userDir' => SassUtil::isRTL() ? 'rtl' : 'ltr', 'content' => $wgLanguageCode, 'contentDir' => $wgContLang->getDir()], 'mainPageTitle' => Title::newMainPage()->getPrefixedDBkey(), 'namespaces' => $wgContLang->getNamespaces(), 'siteMessage' => $this->getSiteMessage(), 'siteName' => $wgSitename, 'theme' => SassUtil::getOasisSettings(), 'wikiCategories' => WikiFactoryHub::getInstance()->getWikiCategoryNames($wgCityId)];
 }