当前位置: 首页>>代码示例>>PHP>>正文


PHP MediaWikiTestCase类代码示例

本文整理汇总了PHP中MediaWikiTestCase的典型用法代码示例。如果您正苦于以下问题:PHP MediaWikiTestCase类的具体用法?PHP MediaWikiTestCase怎么用?PHP MediaWikiTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MediaWikiTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tearDown

 protected function tearDown()
 {
     $this->test_wrapper->destroyManuscriptsTest();
     unset($this->test_wrapper);
     unset($this->t);
     parent::tearDown();
 }
开发者ID:akvankorlaar,项目名称:manuscriptdesk,代码行数:7,代码来源:NewManuscriptWrapperTest.php

示例2: setUp

 protected function setUp()
 {
     global $wgFileBackends;
     parent::setUp();
     $tmpPrefix = wfTempDir() . '/filebackend-unittest-' . time() . '-' . mt_rand();
     if ($this->getCliArg('use-filebackend=')) {
         if (self::$backendToUse) {
             $this->singleBackend = self::$backendToUse;
         } else {
             $name = $this->getCliArg('use-filebackend=');
             $useConfig = array();
             foreach ($wgFileBackends as $conf) {
                 if ($conf['name'] == $name) {
                     $useConfig = $conf;
                     break;
                 }
             }
             $useConfig['name'] = 'localtesting';
             // swap name
             $useConfig['shardViaHashLevels'] = array('unittest-cont1' => array('levels' => 1, 'base' => 16, 'repeat' => 1));
             $class = $useConfig['class'];
             self::$backendToUse = new $class($useConfig);
             $this->singleBackend = self::$backendToUse;
         }
     } else {
         $this->singleBackend = new FSFileBackend(array('name' => 'localtesting', 'lockManager' => 'fsLockManager', 'containerPaths' => array('unittest-cont1' => "{$tmpPrefix}-localtesting-cont1", 'unittest-cont2' => "{$tmpPrefix}-localtesting-cont2")));
     }
     $this->multiBackend = new FileBackendMultiWrite(array('name' => 'localtesting', 'lockManager' => 'fsLockManager', 'parallelize' => 'implicit', 'backends' => array(array('name' => 'localmultitesting1', 'class' => 'FSFileBackend', 'lockManager' => 'nullLockManager', 'containerPaths' => array('unittest-cont1' => "{$tmpPrefix}-localtestingmulti1-cont1", 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti1-cont2"), 'isMultiMaster' => false), array('name' => 'localmultitesting2', 'class' => 'FSFileBackend', 'lockManager' => 'nullLockManager', 'containerPaths' => array('unittest-cont1' => "{$tmpPrefix}-localtestingmulti2-cont1", 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti2-cont2"), 'isMultiMaster' => true))));
     $this->filesToPrune = array();
 }
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:30,代码来源:FileBackendTest.php

示例3: setUp

 function setUp()
 {
     global $wgHooks;
     parent::setUp();
     Hooks::clear('MediaWikiHooksTest001');
     unset($wgHooks['MediaWikiHooksTest001']);
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:7,代码来源:HooksTest.php

示例4: setUp

 protected function setUp()
 {
     global $wgFileBackends;
     parent::setUp();
     $uniqueId = time() . '-' . mt_rand();
     $tmpDir = $this->getNewTempDirectory();
     if ($this->getCliArg('use-filebackend')) {
         if (self::$backendToUse) {
             $this->singleBackend = self::$backendToUse;
         } else {
             $name = $this->getCliArg('use-filebackend');
             $useConfig = array();
             foreach ($wgFileBackends as $conf) {
                 if ($conf['name'] == $name) {
                     $useConfig = $conf;
                     break;
                 }
             }
             $useConfig['name'] = 'localtesting';
             // swap name
             $useConfig['shardViaHashLevels'] = array('unittest-cont1' => array('levels' => 1, 'base' => 16, 'repeat' => 1));
             if (isset($useConfig['fileJournal'])) {
                 $useConfig['fileJournal'] = FileJournal::factory($useConfig['fileJournal'], $name);
             }
             $useConfig['lockManager'] = LockManagerGroup::singleton()->get($useConfig['lockManager']);
             $class = $useConfig['class'];
             self::$backendToUse = new $class($useConfig);
             $this->singleBackend = self::$backendToUse;
         }
     } else {
         $this->singleBackend = new FSFileBackend(array('name' => 'localtesting', 'lockManager' => LockManagerGroup::singleton()->get('fsLockManager'), 'wikiId' => wfWikiID(), 'containerPaths' => array('unittest-cont1' => "{$tmpDir}/localtesting-cont1", 'unittest-cont2' => "{$tmpDir}/localtesting-cont2")));
     }
     $this->multiBackend = new FileBackendMultiWrite(array('name' => 'localtesting', 'lockManager' => LockManagerGroup::singleton()->get('fsLockManager'), 'parallelize' => 'implicit', 'wikiId' => wfWikiId() . $uniqueId, 'backends' => array(array('name' => 'localmultitesting1', 'class' => 'FSFileBackend', 'containerPaths' => array('unittest-cont1' => "{$tmpDir}/localtestingmulti1-cont1", 'unittest-cont2' => "{$tmpDir}/localtestingmulti1-cont2"), 'isMultiMaster' => false), array('name' => 'localmultitesting2', 'class' => 'FSFileBackend', 'containerPaths' => array('unittest-cont1' => "{$tmpDir}/localtestingmulti2-cont1", 'unittest-cont2' => "{$tmpDir}/localtestingmulti2-cont2"), 'isMultiMaster' => true))));
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:34,代码来源:FileBackendTest.php

示例5: tearDown

 protected function tearDown()
 {
     $this->database_test_instance_creator->destroyManuscriptsTest();
     unset($this->database_test_instance_creator);
     unset($this->t);
     parent::tearDown();
 }
开发者ID:akvankorlaar,项目名称:manuscriptdesk,代码行数:7,代码来源:ManuscriptDeskBaseWrapperTest.php

示例6: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->setMwGlobals('wgShowEXIF', true);
     $this->filePath = __DIR__ . '/../../data/media/';
     $this->handler = new TiffHandler();
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:7,代码来源:TiffTest.php

示例7: setUp

 protected function setUp()
 {
     parent::setUp();
     $group = MessageGroupBase::factory($this->groupConfiguration);
     /** @var YamlFFS $ffs */
     $this->ffs = $group->getFFS();
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:7,代码来源:RubyYamlFFSTest.php

示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->cache1 = new HashBagOStuff();
     $this->cache2 = new HashBagOStuff();
     $this->cache = new MultiWriteBagOStuff(array('caches' => array($this->cache1, $this->cache2), 'replication' => 'async'));
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:7,代码来源:MultiWriteBagOStuffTest.php

示例9: setUp

 function setUp()
 {
     parent::setUp();
     require_once __DIR__ . '/../data/helpers/WellProtectedClass.php';
     $this->raw = new WellProtectedClass();
     $this->wrapped = TestingAccessWrapper::newFromObject($this->raw);
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:7,代码来源:TestingAccessWrapperTest.php

示例10: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->writeCache = new HashBagOStuff();
     $this->readCache = new HashBagOStuff();
     $this->cache = new ReplicatedBagOStuff(array('writeFactory' => $this->writeCache, 'readFactory' => $this->readCache));
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:7,代码来源:ReplicatedBagOStuffTest.php

示例11: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->setMwGlobals(['wgAllowUserJs' => false, 'wgDefaultLanguageVariant' => false, 'wgMetaNamespace' => 'Project']);
     $this->setUserLang('en');
     $this->setContentLang('en');
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:7,代码来源:TitleTest.php

示例12: setUp

 protected function setUp()
 {
     parent::setUp();
     if (!CdbReader::haveExtension()) {
         $this->markTestSkipped('Native CDB support is not available');
     }
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:7,代码来源:CdbTest.php

示例13: tearDown

 public function tearDown()
 {
     global $wgShowEXIF, $wgEnableAutoRotation;
     $wgShowEXIF = $this->show;
     $wgEnableAutoRotation = $this->oldAuto;
     parent::tearDown();
 }
开发者ID:Jobava,项目名称:diacritice-meta-repo,代码行数:7,代码来源:ExifRotationTest.php

示例14: tearDown

 public function tearDown()
 {
     // turn off caching again.
     global $wgMainCacheType;
     $wgMainCacheType = $this->oldcache;
     parent::tearDown();
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:7,代码来源:ConcurrencyCheckTest.php

示例15: setUp

 protected function setUp()
 {
     global $wgGroupPermissions;
     parent::setUp();
     $this->stashMwGlobals(['wgGroupPermissions']);
     $wgGroupPermissions['local-id-lookup-test']['hideuser'] = true;
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:7,代码来源:LocalIdLookupTest.php


注:本文中的MediaWikiTestCase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。