Ejemplo n.º 1
0
 /**
  * @return void
  * @covers \pdepend\reflection\api\StaticReflectionMethod
  * @group reflection
  * @group reflection::api
  * @group unittest
  */
 public function testGetNumberOfRequiredParametersReturnsTwoForMethodWithPartialOptionalParameters()
 {
     $param0 = new StaticReflectionParameter('foo', 0);
     $param0->initStaticReflectionValue(new StaticReflectionValue(42));
     $param1 = new StaticReflectionParameter('bar', 1);
     $param2 = new StaticReflectionParameter('baz', 2);
     $param2->initStaticReflectionValue(new StaticReflectionValue(23));
     $method = new StaticReflectionMethod('foo', '', 0);
     $method->initParameters(array($param0, $param1, $param2));
     $this->assertEquals(2, $method->getNumberOfRequiredParameters());
 }