|
@@ 201-217 (lines=17) @@
|
| 198 |
|
/** |
| 199 |
|
* @test |
| 200 |
|
*/ |
| 201 |
|
public function it_marks_passed_by_reference_args_as_passed_by_reference() |
| 202 |
|
{ |
| 203 |
|
$class = new \ReflectionClass('Fixtures\Prophecy\WithReferences'); |
| 204 |
|
|
| 205 |
|
$mirror = new ClassMirror(); |
| 206 |
|
|
| 207 |
|
$classNode = $mirror->reflect($class, array()); |
| 208 |
|
|
| 209 |
|
$this->assertTrue($classNode->hasMethod('methodWithReferenceArgument')); |
| 210 |
|
|
| 211 |
|
$argNodes = $classNode->getMethod('methodWithReferenceArgument')->getArguments(); |
| 212 |
|
|
| 213 |
|
$this->assertCount(2, $argNodes); |
| 214 |
|
|
| 215 |
|
$this->assertTrue($argNodes[0]->isPassedByReference()); |
| 216 |
|
$this->assertTrue($argNodes[1]->isPassedByReference()); |
| 217 |
|
} |
| 218 |
|
|
| 219 |
|
/** |
| 220 |
|
* @test |
|
@@ 383-394 (lines=12) @@
|
| 380 |
|
/** |
| 381 |
|
* @test |
| 382 |
|
*/ |
| 383 |
|
public function it_doesnt_use_scalar_typehints() |
| 384 |
|
{ |
| 385 |
|
$mirror = new ClassMirror(); |
| 386 |
|
|
| 387 |
|
$classNode = $mirror->reflect(new \ReflectionClass('ReflectionMethod'), array()); |
| 388 |
|
$method = $classNode->getMethod('export'); |
| 389 |
|
$arguments = $method->getArguments(); |
| 390 |
|
|
| 391 |
|
$this->assertNull($arguments[0]->getTypeHint()); |
| 392 |
|
$this->assertNull($arguments[1]->getTypeHint()); |
| 393 |
|
$this->assertNull($arguments[2]->getTypeHint()); |
| 394 |
|
} |
| 395 |
|
|
| 396 |
|
/** |
| 397 |
|
* @test |