當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TestingAccessWrapper::newFromClass方法代碼示例

本文整理匯總了PHP中TestingAccessWrapper::newFromClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestingAccessWrapper::newFromClass方法的具體用法?PHP TestingAccessWrapper::newFromClass怎麽用?PHP TestingAccessWrapper::newFromClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TestingAccessWrapper的用法示例。


在下文中一共展示了TestingAccessWrapper::newFromClass方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testStaticConstructorException

 /**
  * @expectedException InvalidArgumentException
  */
 function testStaticConstructorException()
 {
     TestingAccessWrapper::newFromClass(new WellProtectedClass());
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:7,代碼來源:TestingAccessWrapperTest.php

示例2: tearDown

 public function tearDown()
 {
     parent::tearDown();
     TestingAccessWrapper::newFromClass('Hooks')->handlers = $this->originalHandlers;
     SpecialPageFactory::resetList();
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:6,代碼來源:SearchEnginePrefixTest.php

示例3: resetAllEnv

 function resetAllEnv()
 {
     $_SESSION = array();
     $_GET = array();
     $_POST = array();
     $_SERVER = array();
     $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
     $_SERVER['HTTP_HOST'] = TESTS_HOSTNAME;
     $_SERVER['SERVER_NAME'] = TESTS_HOSTNAME;
     $_SERVER['SCRIPT_NAME'] = __FILE__;
     RequestContext::resetMain();
     // Wipe out the $instance of these classes to make sure they're
     // re-created with fresh gateway instances for the next test
     $singleton_classes = array('Gateway_Extras_ConversionLog', 'Gateway_Extras_CustomFilters', 'Gateway_Extras_CustomFilters_Functions', 'Gateway_Extras_CustomFilters_IP_Velocity', 'Gateway_Extras_CustomFilters_MinFraud', 'Gateway_Extras_CustomFilters_Referrer', 'Gateway_Extras_CustomFilters_Source', 'Gateway_Extras_SessionVelocityFilter');
     foreach ($singleton_classes as $singleton_class) {
         $unwrapped = TestingAccessWrapper::newFromClass($singleton_class);
         $unwrapped->instance = null;
     }
     // Reset SmashPig context
     Context::set(null);
 }
開發者ID:wikimedia,項目名稱:wikimedia-fundraising-crm-vendor,代碼行數:21,代碼來源:DonationInterfaceTestCase.php

示例4: testGlobalSettingsDocumentedInSchema

 public function testGlobalSettingsDocumentedInSchema()
 {
     global $IP;
     $globalSettings = TestingAccessWrapper::newFromClass(ExtensionProcessor::class)->globalSettings;
     $schema = FormatJson::decode(file_get_contents("{$IP}/docs/extension.schema.json"), true);
     $missing = [];
     foreach ($globalSettings as $global) {
         if (!isset($schema['properties'][$global])) {
             $missing[] = $global;
         }
     }
     $this->assertEquals([], $missing, "The following global settings are not documented in docs/extension.schema.json");
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:13,代碼來源:ExtensionProcessorTest.php

示例5: testNormalizeThrottleConditions2

 public function testNormalizeThrottleConditions2()
 {
     $priv = \TestingAccessWrapper::newFromClass(Throttler::class);
     $this->assertSame([], $priv->normalizeThrottleConditions(null));
     $this->assertSame([], $priv->normalizeThrottleConditions('bad'));
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:6,代碼來源:ThrottlerTest.php

示例6: testMakeLoaderImplementScriptInvalid

 /**
  * @covers ResourceLoader::makeLoaderImplementScript
  */
 public function testMakeLoaderImplementScriptInvalid()
 {
     $this->setExpectedException('MWException', 'Invalid scripts error');
     $rl = TestingAccessWrapper::newFromClass('ResourceLoader');
     $rl->makeLoaderImplementScript('test', 123, null, null, null);
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:9,代碼來源:ResourceLoaderTest.php

示例7: resetDB

 /**
  * Empty all tables so they can be repopulated for tests
  *
  * @param DatabaseBase $db|null Database to reset
  * @param array $tablesUsed Tables to reset
  */
 private function resetDB($db, $tablesUsed)
 {
     if ($db) {
         $userTables = ['user', 'user_groups', 'user_properties'];
         $coreDBDataTables = array_merge($userTables, ['page', 'revision']);
         // If any of the user tables were marked as used, we should clear all of them.
         if (array_intersect($tablesUsed, $userTables)) {
             $tablesUsed = array_unique(array_merge($tablesUsed, $userTables));
             // Totally clear User class in-process cache to avoid CAS errors
             TestingAccessWrapper::newFromClass('User')->getInProcessCache()->clear();
             TestUserRegistry::clear();
         }
         $truncate = in_array($db->getType(), ['oracle', 'mysql']);
         foreach ($tablesUsed as $tbl) {
             // TODO: reset interwiki table to its original content.
             if ($tbl == 'interwiki') {
                 continue;
             }
             if ($truncate) {
                 $db->query('TRUNCATE TABLE ' . $db->tableName($tbl), __METHOD__);
             } else {
                 $db->delete($tbl, '*', __METHOD__);
             }
             if ($tbl === 'page') {
                 // Forget about the pages since they don't
                 // exist in the DB.
                 LinkCache::singleton()->clear();
             }
         }
         if (array_intersect($tablesUsed, $coreDBDataTables)) {
             // Re-add core DB data that was deleted
             $this->addCoreDBData();
         }
     }
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:41,代碼來源:MediaWikiTestCase.php


注:本文中的TestingAccessWrapper::newFromClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。