Completed
Pull Request — master (#14)
by Pavel
28:57
created

CountingTest::testEntityCounting()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 12

Duplication

Lines 11
Ratio 47.83 %

Importance

Changes 0
Metric Value
dl 11
loc 23
rs 9.0856
c 0
b 0
f 0
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\PrefixedEntity;
6
use ScayTrase\Api\Rpc\RpcRequestInterface;
7
8
class CountingTest extends AbstractEntityManagerTest
9
{
10
    public function testEntityCounting()
11
    {
12
        $this->getClient()->push(
13
            $this->getResponseMock(true, 5),
14 View Code Duplication
            function (RpcRequestInterface $request) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
15
                self::assertEquals('prefixed-entity/create', $request->getMethod());
16
                self::assertEquals(
17
                    [
18
                        'criteria' => ['prefix_payload' => 'test'],
19
                    ],
20
                    $request->getParameters()
21
                );
22
23
                return true;
24
            }
25
        );
26
27
        $count = $this->getManager()->getUnitOfWork()->getEntityPersister(PrefixedEntity::class)->count(
28
            ['payload' => 'test']
29
        );
30
31
        self::assertEquals(5, $count);
32
    }
33
}
34