| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function testBodyStructure() : void |
||
| 26 | { |
||
| 27 | $reflection = new ReflectionClass(EmptyClass::class); |
||
| 28 | $valueHolder = $this->createMock(PropertyGenerator::class); |
||
|
|
|||
| 29 | $prefixInterceptors = $this->createMock(PropertyGenerator::class); |
||
| 30 | $suffixInterceptors = $this->createMock(PropertyGenerator::class); |
||
| 31 | $publicProperties = $this->createMock(PublicPropertiesMap::class); |
||
| 32 | |||
| 33 | $valueHolder->method('getName')->willReturn('bar'); |
||
| 34 | $prefixInterceptors->method('getName')->willReturn('pre'); |
||
| 35 | $suffixInterceptors->method('getName')->willReturn('post'); |
||
| 36 | $publicProperties->method('isEmpty')->willReturn(false); |
||
| 37 | |||
| 38 | $magicGet = new MagicGet( |
||
| 39 | $reflection, |
||
| 40 | $valueHolder, |
||
| 41 | $prefixInterceptors, |
||
| 42 | $suffixInterceptors, |
||
| 43 | $publicProperties |
||
| 44 | ); |
||
| 45 | |||
| 46 | self::assertSame('__get', $magicGet->getName()); |
||
| 47 | self::assertCount(1, $magicGet->getParameters()); |
||
| 48 | self::assertStringMatchesFormat('%A$returnValue = & $this->bar->$name;%A', $magicGet->getBody()); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.