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


PHP ReflectionMethod::setAccessible方法代码示例

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


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

示例1: testUses

 public function testUses()
 {
     $usesMethod = new \ReflectionMethod($this->testInstance, 'uses');
     $usesMethod->setAccessible(true);
     $this->assertSame(['Illuminate\\Translation\\TranslationServiceProvider'], $usesMethod->invoke($this->testInstance));
     $usesMethod->setAccessible(false);
 }
开发者ID:laravel-commode,项目名称:validation-locator,代码行数:7,代码来源:ValidationLocatorServiceProviderTest.php

示例2: testFacade

 public function testFacade()
 {
     $accessorMethod = new \ReflectionMethod(NavigationBagFacade::class, 'getFacadeAccessor');
     $accessorMethod->setAccessible(true);
     $this->assertSame(NavigationBagServiceProvider::PROVIDES_SERVICE, $accessorMethod->invoke(null));
     $accessorMethod->setAccessible(false);
 }
开发者ID:laravel-commode,项目名称:navigation-bag,代码行数:7,代码来源:NavigationBagFacadeTest.php

示例3: testUses

 public function testUses()
 {
     $reflectionMethod = new \ReflectionMethod($this->testInstance, 'uses');
     $reflectionMethod->setAccessible(true);
     $this->assertSame([ValidationLocatorServiceProvider::class], $reflectionMethod->invoke($this->testInstance));
     $reflectionMethod->setAccessible(false);
 }
开发者ID:laravel-commode,项目名称:viewmodel,代码行数:7,代码来源:ViewModelServiceProviderTest.php

示例4: testAccessor

 public function testAccessor()
 {
     $method = new \ReflectionMethod(ValidationLocator::class, 'getFacadeAccessor');
     $method->setAccessible(true);
     $this->assertSame(ValidationLocatorServiceProvider::PROVIDES_LOCATOR, $method->invoke(null));
     $method->setAccessible(false);
 }
开发者ID:laravel-commode,项目名称:validation-locator,代码行数:7,代码来源:ValidationLocatorTest.php

示例5: testUses

 public function testUses()
 {
     $usesMethod = new \ReflectionMethod($this->testInstance, 'uses');
     $usesMethod->setAccessible(true);
     $this->assertSame([SessionServiceProvider::class, RoutingServiceProvider::class], $usesMethod->invoke($this->testInstance));
     $usesMethod->setAccessible(false);
 }
开发者ID:laravel-commode,项目名称:navigation-bag,代码行数:7,代码来源:NavigationBagServiceProviderTest.php

示例6: setSetterMethod

 /**
  * @param \ReflectionMethod $setterMethod
  */
 public function setSetterMethod($setterMethod)
 {
     $this->setterMethod = $setterMethod;
     if ($this->setterMethod) {
         $this->setterMethod->setAccessible(TRUE);
     }
 }
开发者ID:20steps,项目名称:autotables-bundle,代码行数:10,代码来源:MethodColumnDescriptor.php

示例7: testAccessor

 public function testAccessor()
 {
     $reflectionMethod = new \ReflectionMethod(BladedFacade::class, 'getFacadeAccessor');
     $reflectionMethod->setAccessible(true);
     $this->assertSame(BladedServiceProvider::PROVIDES_SERVICE, $reflectionMethod->invoke(null));
     $reflectionMethod->setAccessible(false);
 }
开发者ID:laravel-commode,项目名称:bladed,代码行数:7,代码来源:BladedFacadeTest.php

示例8: __construct

 /**
  * Constructor
  *
  * @param string $class
  * @param string $name
  */
 public function __construct($class, $name)
 {
     $this->class = $class;
     $this->name = $name;
     $this->reflection = new \ReflectionMethod($class, $name);
     $this->reflection->setAccessible(true);
 }
开发者ID:novaway,项目名称:open-graph,代码行数:13,代码来源:MethodMetadata.php

示例9: testGetLastChildKey

 /**
  * Test the sanity check for behaviour on empty children list
  * which should never happen as this is protected method
  */
 public function testGetLastChildKey()
 {
     $object = JsonNode::factory(array());
     $method = new \ReflectionMethod($object, 'getLastChildKey');
     $method->setAccessible(true);
     $this->assertNull($method->invoke($object));
     $method->setAccessible(false);
 }
开发者ID:sammuelyee,项目名称:facebook-php-ads-sdk,代码行数:12,代码来源:JsonNodeTest.php

示例10: __construct

 public function __construct(PropertyAnnotation $annotation, \ReflectionMethod $reflection)
 {
     $this->reflection = $reflection;
     $this->annotation = $annotation;
     if ($this->reflection->isPrivate() || $this->reflection->isProtected()) {
         $this->reflection->setAccessible(true);
     }
 }
开发者ID:agnetsolutions,项目名称:common,代码行数:8,代码来源:DefaultMethodMetadata.php

示例11: setup

 public function setup()
 {
     $class = new \ReflectionClass('BsbFlysystemTest\\Assets\\SimpleAdapterFactory');
     $this->property = $class->getProperty('options');
     $this->property->setAccessible(true);
     $this->method = $class->getMethod('mergeMvcConfig');
     $this->method->setAccessible(true);
 }
开发者ID:stefanotorresi,项目名称:BsbFlysystem,代码行数:8,代码来源:AbstractAdapterFactoryTest.php

示例12: setUp

 /**
  * Set up
  */
 protected function setUp()
 {
     require_once 'Fixtures/ConditionMatcherUserFuncs.php';
     $this->backupApplicationContext = GeneralUtility::getApplicationContext();
     $this->conditionMatcher = $this->getMockForAbstractClass(AbstractConditionMatcher::class);
     $this->evaluateConditionCommonMethod = new \ReflectionMethod(AbstractConditionMatcher::class, 'evaluateConditionCommon');
     $this->evaluateConditionCommonMethod->setAccessible(TRUE);
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:11,代码来源:AbstractConditionMatcherTest.php

示例13: testGetFormTypeFqcn

 /**
  * @dataProvider shortTypesToFqcnProvider
  */
 public function testGetFormTypeFqcn($shortType, $expected)
 {
     $configuratorMock = $this->getMockBuilder('JavierEguiluz\\Bundle\\EasyAdminBundle\\Configuration\\Configurator')->disableOriginalConstructor()->getMock();
     $type = new EasyAdminFormType($configuratorMock, array(), array());
     $method = new \ReflectionMethod($type, 'getFormTypeFqcn');
     $method->setAccessible(true);
     $this->assertSame($expected, $method->invoke($type, $shortType));
     $method->setAccessible(false);
 }
开发者ID:sebastianlp,项目名称:EasyAdminBundle,代码行数:12,代码来源:EasyAdminFormTypeTest.php

示例14: setUp

 public function setUp()
 {
     parent::setUp();
     $this->orderByTrait = $this->getObjectForTrait(OrderByTrait::class);
     $this->queryBuilder = $this->prophesize(QueryBuilder::class);
     $reflectionClass = new \ReflectionClass($this->orderByTrait);
     $this->addOrderByFunction = $reflectionClass->getMethod('addOrderBy');
     $this->addOrderByFunction->setAccessible(true);
 }
开发者ID:ollietb,项目名称:sulu,代码行数:9,代码来源:OrderByTraitTest.php

示例15: __construct

 /**
  * @param AclCheckerInterface $aclChecker
  * @param Stopwatch           $stopwatch
  */
 public function __construct(AclCheckerInterface $aclChecker, Stopwatch $stopwatch)
 {
     $this->getObjectToSecure = new \ReflectionMethod('Nuxia\\AclBundle\\Manager\\AclChecker', 'getObjectToSecure');
     $this->getObjectToSecure->setAccessible(true);
     $aclIdentifierProperty = new \ReflectionProperty('Nuxia\\AclBundle\\Manager\\AclChecker', 'aclIdentifier');
     $aclIdentifierProperty->setAccessible(true);
     $this->aclIdentifier = $aclIdentifierProperty->getValue($aclChecker);
     $this->aclChecker = $aclChecker;
     $this->stopwatch = $stopwatch;
     $this->checks = [];
 }
开发者ID:dragosprotung,项目名称:AclBundle,代码行数:15,代码来源:AclCheckerCollector.php


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