当前位置: 首页>>代码示例>>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;未经允许,请勿转载。