We were only passing the first parameter to the wrapped object's methods.
Change-Id: I27a69d1cc1b2d048e44514af8b4ac79d7ee1fb85
public function getProperty() {
return $this->property;
}
+
+ protected function whatSecondArg( $a, $b = false ) {
+ return $b;
+ }
}
$classReflection = new ReflectionClass( $this->object );
$methodReflection = $classReflection->getMethod( $method );
$methodReflection->setAccessible( true );
- return $methodReflection->invoke( $this->object, $args );
+ return $methodReflection->invokeArgs( $this->object, $args );
}
public function __set( $name, $value ) {
$this->assertSame( 2, $this->wrapped->property );
$this->assertSame( 2, $this->raw->getProperty() );
}
+
+ function testCallMethodTwoArgs() {
+ $this->assertSame( 'two', $this->wrapped->whatSecondArg( 'one', 'two' ) );
+ }
}