@@ -177,7 +177,7 @@ public function testSetStaticProperty() {
177
177
* @dataProvider dataCallMethod
178
178
*/
179
179
public function testCallMethod (string $ object_property , string $ method_name , int $ input , int $ expected ) {
180
- $ this ->assertSame ($ expected , reflection::call_method ($ this ->{$ object_property }, $ method_name , $ input ));
180
+ $ this ->assertSame ($ expected , reflection::call_method ($ this ->{$ object_property }, $ method_name , [ $ input] ));
181
181
}
182
182
183
183
public function dataCallMethod (): array {
@@ -191,7 +191,7 @@ public function dataCallMethod(): array {
191
191
* @dataProvider dataCallStaticMethod
192
192
*/
193
193
public function testCallStaticMethod (string $ class_name , string $ method_name , int $ input , int $ expected ) {
194
- $ this ->assertSame ($ expected , reflection::call_method ($ class_name , $ method_name , $ input ));
194
+ $ this ->assertSame ($ expected , reflection::call_method ($ class_name , $ method_name , [ $ input] ));
195
195
}
196
196
197
197
public function dataCallStaticMethod (): array {
@@ -205,19 +205,26 @@ public function testCallMethodWithReference() {
205
205
$ test_value = 10 ;
206
206
$ expected_value = ($ test_value * 2 );
207
207
208
- reflection::call_method ($ this ->example_object , 'test_reference_method ' , $ test_value );
208
+ reflection::call_method ($ this ->example_object , 'test_reference_method ' , [& $ test_value] );
209
209
210
210
$ this ->assertSame ($ expected_value , $ test_value );
211
211
}
212
212
213
213
public function testCallMethodSetReferenceValue () {
214
214
$ expected_value = 'wow such test ' ;
215
215
216
- reflection::call_method ($ this ->example_object , 'test_set_reference_method ' , $ actual_value , $ expected_value );
216
+ reflection::call_method ($ this ->example_object , 'test_set_reference_method ' , [& $ actual_value , & $ expected_value] );
217
217
218
218
$ this ->assertSame ($ expected_value , $ actual_value );
219
219
}
220
220
221
+ public function testCallMethodWithValue () {
222
+ // Not using a variable here as we need to test a value vs a reference
223
+ $ result = reflection::call_method ($ this ->example_object , 'test_value_method ' , ['some string ' ]);
224
+
225
+ $ this ->assertSame ('some string ' , $ result );
226
+ }
227
+
221
228
//
222
229
223
230
}
0 commit comments