| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function testIndirectId() |
||
| 11 | { |
||
| 12 | $repository = $this->getManager()->getRepository(IndirectIdEntity::class); |
||
| 13 | $this->getClient()->push( |
||
| 14 | $this->getResponseMock( |
||
| 15 | true, |
||
| 16 | (object)[ |
||
| 17 | 'some-long-api-field-name' => 241, |
||
| 18 | 'payload' => 'test', |
||
| 19 | ] |
||
| 20 | ), |
||
| 21 | function (RpcRequestInterface $request) { |
||
| 22 | self::assertEquals('indirect-entity/find', $request->getMethod()); |
||
| 23 | self::assertEquals(['some-long-api-field-name' => 241], $request->getParameters()); |
||
| 24 | |||
| 25 | return true; |
||
| 26 | } |
||
| 27 | ); |
||
| 28 | |||
| 29 | /** @var IndirectIdEntity $entity */ |
||
| 30 | $entity = $repository->find(241); |
||
| 31 | |||
| 32 | self::assertInstanceOf(IndirectIdEntity::class, $entity); |
||
| 33 | self::assertEquals(241, $entity->getId()); |
||
| 34 | self::assertEquals('test', $entity->getPayload()); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |