createResultWithItems()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Zenstruck\Porpaginas\Tests\Doctrine;
4
5
use Zenstruck\Porpaginas\Doctrine\DBALQueryBuilderResult;
6
use Zenstruck\Porpaginas\Result;
7
use Zenstruck\Porpaginas\Tests\ResultTest;
8
9
/**
10
 * @author Kevin Bond <[email protected]>
11
 */
12
class DBALQueryBuilderResultTest extends ResultTest
13
{
14
    use HasEntityManager;
15
16
    protected function createResultWithItems(int $count): Result
17
    {
18
        $this->persistEntities($count);
19
20
        $qb = $this->em->getConnection()->createQueryBuilder()
0 ignored issues
show
Bug introduced by
The method getConnection() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        $qb = $this->em->/** @scrutinizer ignore-call */ getConnection()->createQueryBuilder()

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.

Loading history...
21
            ->select('*')
22
            ->from('ORMEntity', 'e')
23
        ;
24
25
        return new DBALQueryBuilderResult($qb);
26
    }
27
28
    protected function getExpectedValueAtPosition(int $position)
29
    {
30
        return ['id' => $position, 'value' => 'value '.$position];
31
    }
32
}
33