| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function testHydratorNotFound() |
||
| 13 | { |
||
| 14 | $resolvableInputObjectType = $this->getMockBuilder(ResolvableInputObjectType::class) |
||
| 15 | ->disableOriginalConstructor() |
||
| 16 | ->setMethods(['resolve']) |
||
| 17 | ->getMock(); |
||
| 18 | $resolvableInputObjectType->method('resolve')->willReturn(new stdClass()); |
||
|
|
|||
| 19 | |||
| 20 | $badObjectType = new InputObjectType([ |
||
| 21 | 'name' => 'foo' |
||
| 22 | ]); |
||
| 23 | |||
| 24 | $factoryHydrator = new FactoryHydrator(); |
||
| 25 | |||
| 26 | $this->assertTrue($factoryHydrator->canHydrate([], $resolvableInputObjectType)); |
||
| 27 | $this->assertFalse($factoryHydrator->canHydrate([], $badObjectType)); |
||
| 28 | |||
| 29 | $this->assertEquals(new stdClass(), $factoryHydrator->hydrate([], $resolvableInputObjectType)); |
||
| 30 | |||
| 31 | $this->expectException(CannotHydrateException::class); |
||
| 32 | $factoryHydrator->hydrate([], $badObjectType); |
||
| 33 | } |
||
| 35 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.