Example #1
0
 /**
  * Initialize/fetch the ApiMain instance for testing
  * @return ApiMain
  */
 private static function getMain()
 {
     if (!self::$main) {
         self::$main = new ApiMain(RequestContext::getMain());
         self::$main->getContext()->setLanguage('en');
     }
     return self::$main;
 }
Example #2
0
 /**
  * Initialize/fetch the ApiMain instance for testing
  * @return ApiMain
  */
 private static function getMain()
 {
     if (!self::$main) {
         self::$main = new ApiMain(RequestContext::getMain());
         self::$main->getContext()->setLanguage('en');
         self::$main->getContext()->setTitle(Title::makeTitle(NS_SPECIAL, 'Badtitle/dummy title for ApiDocumentationTest'));
     }
     return self::$main;
 }
Example #3
0
 /**
  * @param ApiMain $mainModule
  * @param string $moduleName Name of this module
  * @param string $modulePrefix Prefix to use for parameter names
  */
 public function __construct(ApiMain $mainModule, $moduleName, $modulePrefix = '')
 {
     $this->mMainModule = $mainModule;
     $this->mModuleName = $moduleName;
     $this->mModulePrefix = $modulePrefix;
     if (!$this->isMain()) {
         $this->setContext($mainModule->getContext());
     }
 }