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


PHP ReflectionMethod::invokeArgs方法代码示例

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


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

示例1: testOn_escapeTemplate

 /**
  * @covers LightnCandy\SafeString::escapeTemplate
  */
 public function testOn_escapeTemplate()
 {
     $method = new \ReflectionMethod('LightnCandy\\SafeString', 'escapeTemplate');
     $this->assertEquals('abc', $method->invokeArgs(null, array_by_ref(array('abc'))));
     $this->assertEquals('a\\\\bc', $method->invokeArgs(null, array_by_ref(array('a\\bc'))));
     $this->assertEquals('a\\\'bc', $method->invokeArgs(null, array_by_ref(array('a\'bc'))));
 }
开发者ID:zordius,项目名称:lightncandy,代码行数:10,代码来源:SafeStringTest.php

示例2: execute

 public function execute($argv)
 {
     if (!is_array($argv)) {
         $argv = array($argv);
     }
     $argc = count($argv);
     if (empty($this->action)) {
         throw new \Jolt\Exception('controller_action_not_set');
     }
     try {
         $action = new \ReflectionMethod($this, $this->action);
     } catch (\ReflectionException $e) {
         throw new \Jolt\Exception('controller_action_not_part_of_class');
     }
     $paramCount = $action->getNumberOfRequiredParameters();
     if ($paramCount != $argc && $paramCount > $argc) {
         $argv = array_pad($argv, $paramCount, NULL);
     }
     ob_start();
     if ($action->isPublic()) {
         if ($action->isStatic()) {
             $action->invokeArgs(NULL, $argv);
         } else {
             $action->invokeArgs($this, $argv);
         }
     }
     $renderedController = ob_get_clean();
     if (!empty($renderedController)) {
         $this->renderedController = $renderedController;
     } else {
         $this->renderedController = $this->renderedView;
     }
     return $this->renderedController;
 }
开发者ID:kennyma,项目名称:Jolt,代码行数:34,代码来源:Controller.php

示例3: testOn_handleError

 /**
  * @covers LightnCandy\LightnCandy::handleError
  */
 public function testOn_handleError()
 {
     $method = new \ReflectionMethod('LightnCandy\\LightnCandy', 'handleError');
     $method->setAccessible(true);
     $this->assertEquals(false, $method->invokeArgs(null, array_by_ref(array(array('error' => array())))));
     $this->assertEquals(true, $method->invokeArgs(null, array_by_ref(array(array('error' => array('some error'), 'flags' => array('errorlog' => 0, 'exception' => 0))))));
 }
开发者ID:shile23,项目名称:ToDo-separated,代码行数:10,代码来源:LightnCandyTest.php

示例4: testOn_toString

 /**
  * @covers LightnCandy\Token::toString
  */
 public function testOn_toString()
 {
     $method = new \ReflectionMethod('LightnCandy\\Token', 'toString');
     $this->assertEquals('c', $method->invokeArgs(null, array_by_ref(array(array(0, 'a', 'b', 'c', 'd', 'e')))));
     $this->assertEquals('cd', $method->invokeArgs(null, array_by_ref(array(array(0, 'a', 'b', 'c', 'd', 'e', 'f')))));
     $this->assertEquals('qd', $method->invokeArgs(null, array_by_ref(array(array(0, 'a', 'b', 'c', 'd', 'e', 'f'), array(3 => 'q')))));
 }
开发者ID:shile23,项目名称:ToDo-separated,代码行数:10,代码来源:TokenTest.php

示例5: testAddOrderBy

 /**
  * @dataProvider orderByProvider
  */
 public function testAddOrderBy($alias, $orderBy, $expectedOrderBy)
 {
     foreach ($expectedOrderBy as $field => $order) {
         $this->queryBuilder->addOrderBy($field, $order)->shouldBeCalledTimes(1);
     }
     $this->addOrderByFunction->invokeArgs($this->orderByTrait, [$this->queryBuilder->reveal(), $alias, $orderBy]);
 }
开发者ID:ollietb,项目名称:sulu,代码行数:10,代码来源:OrderByTraitTest.php

示例6: testRelToAbs

 public function testRelToAbs()
 {
     $method = new ReflectionMethod('gsavastano\\Dssg\\Dssg', 'relToAbs');
     $method->setAccessible(TRUE);
     $this->assertEquals('http://www.example.com/rel2abs', $method->invokeArgs(new Dssg(), array('/rel2abs', 'http://www.example.com/')));
     $this->assertEquals('http://www.example.com/../rel2abs', $method->invokeArgs(new Dssg(), array('../rel2abs', 'http://www.example.com/')));
     $this->assertNotEquals('http://www.example.com/rel2abs', $method->invokeArgs(new Dssg(), array('http://example.com/rel2abs', 'http://www.example.com/')));
 }
开发者ID:gsavastano,项目名称:dssg,代码行数:8,代码来源:DssgTest.php

示例7: call

 /**
  * Call a class reference method with set parameters.
  * @param $classInstance instantiated class name
  */
 public function call($classInstance)
 {
     if (isset($this->parameters)) {
         $this->method->invokeArgs($classInstance, $this->parameters);
     } else {
         $this->method->invoke($classInstance);
     }
 }
开发者ID:radekstepan,项目名称:Clubhouse,代码行数:12,代码来源:ApplicationReflection.php

示例8: __call

 public function __call($methodName, array $args)
 {
     $method = new \ReflectionMethod($this->class, $methodName);
     if (!$method->isPublic()) {
         $method->setAccessible(true);
     }
     return $method->isStatic() ? $method->invokeArgs(null, $args) : $method->invokeArgs($this->object, $args);
 }
开发者ID:ptrofimov,项目名称:xpmock,代码行数:8,代码来源:Reflection.php

示例9: testOn_addUsageCount

 /**
  * @covers LightnCandy\Compiler::addUsageCount
  */
 public function testOn_addUsageCount()
 {
     $method = new \ReflectionMethod('LightnCandy\\Compiler', 'addUsageCount');
     $method->setAccessible(true);
     $this->assertEquals(1, $method->invokeArgs(null, array_by_ref(array(array('usedCount' => array('test' => array())), 'test', 'testname'))));
     $this->assertEquals(3, $method->invokeArgs(null, array_by_ref(array(array('usedCount' => array('test' => array('testname' => 2))), 'test', 'testname'))));
     $this->assertEquals(5, $method->invokeArgs(null, array_by_ref(array(array('usedCount' => array('test' => array('testname' => 2))), 'test', 'testname', 3))));
 }
开发者ID:zordius,项目名称:lightncandy,代码行数:11,代码来源:CompilerTest.php

示例10: testOn_encq

 /**
  * @covers LightnCandy\Encoder::encq
  */
 public function testOn_encq()
 {
     $method = new \ReflectionMethod('LightnCandy\\Encoder', 'encq');
     $this->assertEquals('a', $method->invokeArgs(null, array_by_ref(array(array('flags' => array('mustlam' => 0, 'lambda' => 0)), 'a'))));
     $this->assertEquals('a&b', $method->invokeArgs(null, array_by_ref(array(array('flags' => array('mustlam' => 0, 'lambda' => 0)), 'a&b'))));
     $this->assertEquals('a'b', $method->invokeArgs(null, array_by_ref(array(array('flags' => array('mustlam' => 0, 'lambda' => 0)), 'a\'b'))));
     $this->assertEquals('`a'b', $method->invokeArgs(null, array_by_ref(array(array('flags' => array('mustlam' => 0, 'lambda' => 0)), '`a\'b'))));
 }
开发者ID:zordius,项目名称:lightncandy,代码行数:11,代码来源:EncoderTest.php

示例11: testCountryCodeSearch

 public function testCountryCodeSearch()
 {
     $method = new ReflectionMethod('Player', 'countryCode');
     $method->setAccessible(TRUE);
     $player = new Player(null);
     $this->assertEquals('FI', $method->invokeArgs($player, array('Finland')));
     $this->assertEquals('UNK', $method->invokeArgs($player, array('Random')));
     $this->assertEquals('UNK', $method->invokeArgs($player, array(123)));
 }
开发者ID:rikukissa,项目名称:kzstats-local,代码行数:9,代码来源:PlayerTest.php

示例12: testOn_prePartial

 /**
  * @covers LightnCandy\Partial::prePartial
  */
 public function testOn_prePartial()
 {
     $method = new \ReflectionMethod('LightnCandy\\Partial', 'prePartial');
     $method->setAccessible(true);
     $this->assertEquals('hey', $method->invokeArgs(null, array_by_ref(array(array('prepartial' => false), 'hey', 'haha'))));
     $this->assertEquals('haha-hoho', $method->invokeArgs(null, array_by_ref(array(array('prepartial' => function ($cx, $tmpl, $name) {
         return "{$name}-{$tmpl}";
     }), 'hoho', 'haha'))));
 }
开发者ID:zordius,项目名称:lightncandy,代码行数:12,代码来源:PartialTest.php

示例13: testCreateTableDDL

 public function testCreateTableDDL()
 {
     $driver = new \T4\Dbal\Drivers\Mysql();
     $reflector = new ReflectionMethod($driver, 'createTableDDL');
     $reflector->setAccessible(true);
     $this->assertEquals('CREATE TABLE `foo`' . "\n" . '(' . "\n" . '`__id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,' . "\n" . 'PRIMARY KEY (`__id`)' . "\n" . ')', $reflector->invokeArgs($driver, ['foo', []]));
     $this->assertEquals('CREATE TABLE `foo`' . "\n" . '(' . "\n" . '`__id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,' . "\n" . '`foo` INT(11),' . "\n" . '`bar` VARCHAR(255),' . "\n" . 'PRIMARY KEY (`__id`)' . "\n" . ')', $reflector->invokeArgs($driver, ['foo', ['foo' => ['type' => 'int'], 'bar' => ['type' => 'string']]]));
     $this->assertEquals('CREATE TABLE `foo`' . "\n" . '(' . "\n" . '`__id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,' . "\n" . '`lnk` BIGINT UNSIGNED NOT NULL DEFAULT \'0\',' . "\n" . '`foo` INT(11),' . "\n" . '`bar` VARCHAR(255),' . "\n" . 'PRIMARY KEY (`__id`),' . "\n" . 'INDEX `lnk_idx` (`lnk`)' . "\n" . ')', $reflector->invokeArgs($driver, ['foo', ['lnk' => ['type' => 'link'], 'foo' => ['type' => 'int'], 'bar' => ['type' => 'string']]]));
 }
开发者ID:RayManOff,项目名称:t4,代码行数:9,代码来源:MysqlDriverTest.php

示例14: testCreateTableDDL

 public function testCreateTableDDL()
 {
     $driver = new \T4\Dbal\Drivers\Pgsql();
     $reflector = new ReflectionMethod($driver, 'createTableDDL');
     $reflector->setAccessible(true);
     $this->assertEquals(['CREATE TABLE "foo"' . "\n" . '("__id" BIGSERIAL PRIMARY KEY)'], $reflector->invokeArgs($driver, ['foo', []]));
     $this->assertEquals(['CREATE TABLE "foo"' . "\n" . '("__id" BIGSERIAL PRIMARY KEY, "foo" INTEGER, "bar" VARCHAR)'], $reflector->invokeArgs($driver, ['foo', ['foo' => ['type' => 'int'], 'bar' => ['type' => 'string']]]));
     $this->assertEquals(['CREATE TABLE "foo"' . "\n" . '("__id" BIGSERIAL PRIMARY KEY, "lnk" BIGINT NOT NULL DEFAULT \'0\', "foo" INTEGER, "bar" VARCHAR)', 'CREATE INDEX ON "foo" ("lnk")'], $reflector->invokeArgs($driver, ['foo', ['lnk' => ['type' => 'link'], 'foo' => ['type' => 'int'], 'bar' => ['type' => 'string']]]));
 }
开发者ID:RayManOff,项目名称:t4,代码行数:9,代码来源:PgsqlDriverTest.php

示例15: testEvalGroupParsesSimpleAndsAndOrs

 public function testEvalGroupParsesSimpleAndsAndOrs()
 {
     $reflectionMethod = new \ReflectionMethod($this->evaluator, 'evalGroup');
     $reflectionMethod->setAccessible(\true);
     $result = $reflectionMethod->invokeArgs($this->evaluator, [[1 => '0|0|0|1|0&1']]);
     $this->assertSame(1, $result);
     $result = $reflectionMethod->invokeArgs($this->evaluator, [[1 => '0|0|0|0|0&0']]);
     $this->assertSame(0, $result);
 }
开发者ID:nicoswd,项目名称:php-rule-parser,代码行数:9,代码来源:EvaluatorTest.php


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