Example #1
0
 /**
  * Tests getting the method arguments array for a reflected method.
  */
 public function testGetMethodArgs()
 {
     // Note: The arguments aren't indexed with the name of the parameter.
     $expectedArgs = array(0 => 321, 1 => array('test'), 2 => '123');
     // We're going to set the userId to 321 in $_GET (but be sure nothing else is in there).
     $GLOBALS['_GET'] = array('userId' => 321, 'data' => 'test');
     $mockController = new MockController();
     $methodObject = $this->application->getMethodObject($mockController, 'methodWithParams');
     $methodArgs = $this->application->getMethodArgs($methodObject);
     // Did it work?
     $this->assertEquals($expectedArgs, $methodArgs);
 }