Example #1
0
 public function testMultipleWhitespaceBetweenDoctagsAndTypes()
 {
     $function = new ReflectionFunction('Zend_Server_Reflection_FunctionTest_function3');
     $r = new Zend_Server_Reflection_Function($function);
     $prototypes = $r->getPrototypes();
     $this->assertTrue(is_array($prototypes));
     $this->assertTrue(0 < count($prototypes));
     $this->assertEquals(1, count($prototypes));
     $proto = $prototypes[0];
     $params = $proto->getParameters();
     $this->assertTrue(is_array($params));
     $this->assertEquals(1, count($params));
     $this->assertEquals('string', $params[0]->getType());
 }
Example #2
0
 /**
  * @group ZF-6996
  */
 public function testParameterReflectionShouldReturnTypeAndVarnameAndDescription()
 {
     $function = new ReflectionFunction('Zend_Server_Reflection_FunctionTest_function');
     $r = new Zend_Server_Reflection_Function($function);
     $prototypes = $r->getPrototypes();
     $prototype = $prototypes[0];
     $params = $prototype->getParameters();
     $param = $params[0];
     $this->assertContains('Some description', $param->getDescription(), var_export($param, 1));
 }
 public function testGetInvokeArguments()
 {
     $function = new ReflectionFunction('Zend_Server_Reflection_FunctionTest_function');
     $r = new Zend_Server_Reflection_Function($function);
     $args = $r->getInvokeArguments();
     $this->assertTrue(is_array($args));
     $this->assertEquals(0, count($args));
     $argv = array('string1', 'string2');
     $r = new Zend_Server_Reflection_Function($function, null, $argv);
     $args = $r->getInvokeArguments();
     $this->assertTrue(is_array($args));
     $this->assertEquals(2, count($args));
     $this->assertTrue($argv === $args);
 }