Completed
Pull Request — master (#14)
by Pavel
03:24
created

IndirectFieldsTestAbstract::testIndirectId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 12

Duplication

Lines 20
Ratio 100 %

Importance

Changes 0
Metric Value
dl 20
loc 20
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
namespace Bankiru\Api\Doctrine\Tests;
4
5
use Bankiru\Api\Doctrine\Test\Entity\IndirectIdEntity;
6
7
class IndirectFieldsTestAbstract extends AbstractEntityManagerTest
8
{
9 View Code Duplication
    public function testIndirectId()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
    {
11
        $repository = $this->getManager()->getRepository(IndirectIdEntity::class);
12
        $this->getClient()->push(
13
            $this->getResponseMock(
14
                true,
15
                (object)[
16
                    'some-long-api-field-name' => 241,
17
                    'payload'                  => 'test',
18
                ]
19
            )
20
        );
21
22
        /** @var IndirectIdEntity $entity */
23
        $entity = $repository->find(241);
24
25
        self::assertInstanceOf(IndirectIdEntity::class, $entity);
26
        self::assertEquals(241, $entity->getId());
27
        self::assertEquals('test', $entity->getPayload());
28
    }
29
}
30