public function setUpFixtures() { // function with undocumented parameter $t that has default value 'foo' $function = new ezcReflectionFunction('mmm'); $this->actual['mmm'] = $function->getParameters(); // function with three parameters that have type annotations but no type hints // $this->expectedFunctionM1 = new ReflectionFunction( 'm1' ); // $this->expected['m1'] = $this->expectedFunctionM1->getParameters(); $this->actualFunctionM1 = new ezcReflectionFunction('m1'); $this->actualParamsOfM1 = $this->actualFunctionM1->getParameters(); // method with one undocumented parameter // $this->expectedMethod_TestMethods_m3 // = new ReflectionMethod( 'TestMethods', 'm3' ); // $this->expected['TestMethods::m3'] // = $this->expectedMethod_TestMethods_m3->getParameters(); $this->actualMethod_TestMethods_m3 = new ezcReflectionMethod('TestMethods', 'm3'); $this->actualParamsOf_TestMethods_m3 = $this->actualMethod_TestMethods_m3->getParameters(); // method with parameter that has type hint // $expMethod // = new ReflectionMethod( 'ezcReflection', 'setReflectionTypeFactory' ); // $this->expected['ezcReflection::setReflectionTypeFactory'] // = $expMethod->getParameters(); $this->actualMethod_ezcReflection_setReflectionTypeFactory = new ezcReflectionMethod('ezcReflection', 'setReflectionTypeFactory'); $this->actualParamsOf_ezcReflection_setReflectionTypeFactory = $this->actualMethod_ezcReflection_setReflectionTypeFactory->getParameters(); // function with parameter that has type hint only // $expFunction = new ReflectionFunction( 'functionWithTypeHint' ); // $this->expected['functionWithTypeHint'] = $expFunction->getParameters(); $this->actualFunction_functionWithTypeHint = new ezcReflectionFunction('functionWithTypeHint'); $this->actualParamsOf_functionWithTypeHint = $this->actualFunction_functionWithTypeHint->getParameters(); unset($this->expectedFunctionM1, $this->expectedMethod_TestMethods_m3, $this->expectedMethod_ezcReflection_setReflectionTypeFactory, $this->expectedFunction_functionWithTypeHint, $this->actualFunctionM1, $this->actualMethod_TestMethods_m3, $this->actualMethod_ezcReflection_setReflectionTypeFactory, $this->actualFunction_functionWithTypeHint); }
public function testGetParameters() { $func = new ezcReflectionFunction('m1'); $params = $func->getParameters(); $expected = array('test', 'test2', 'test3'); ReflectionTestHelper::expectedParams($expected, $params, $this); $func = $this->fctM3; $params = $func->getParameters(); self::assertTrue(count($params) == 0); }