當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。