Conditions | 1 |
Paths | 1 |
Total Lines | 27 |
Code Lines | 15 |
Lines | 27 |
Ratio | 100 % |
Tests | 20 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
10 | 1 | public function testIndirectId() |
|
11 | { |
||
12 | 1 | $repository = $this->getManager()->getRepository(IndirectIdEntity::class); |
|
13 | 1 | $this->getResponseMock()->append( |
|
14 | 1 | new Response( |
|
15 | 1 | 200, |
|
16 | 1 | [], |
|
17 | 1 | json_encode( |
|
18 | [ |
||
19 | 1 | 'jsonrpc' => '2.0', |
|
20 | 1 | 'id' => 'test', |
|
21 | 'result' => [ |
||
22 | 1 | 'some-long-api-field-name' => 241, |
|
23 | 1 | 'payload' => 'test', |
|
24 | 1 | ], |
|
25 | ] |
||
26 | 1 | ) |
|
27 | 1 | ) |
|
28 | 1 | ); |
|
29 | |||
30 | /** @var IndirectIdEntity $entity */ |
||
31 | 1 | $entity = $repository->find(241); |
|
32 | |||
33 | 1 | self::assertInstanceOf(IndirectIdEntity::class, $entity); |
|
34 | 1 | self::assertEquals(241, $entity->getId()); |
|
35 | 1 | self::assertEquals('test', $entity->getPayload()); |
|
36 | 1 | } |
|
37 | } |
||
38 |