MaterialRepositoryTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApplicationTest\Repository;
6
7
use Application\Model\Material;
8
use Application\Repository\MaterialRepository;
9
10
class MaterialRepositoryTest extends AbstractRepositoryTest
11
{
12
    private MaterialRepository $repository;
13
14
    protected function setUp(): void
15
    {
16
        parent::setUp();
17
        $this->repository = _em()->getRepository(Material::class);
18
    }
19
20
    public function testGetSelfAndDescendantsSubQuery(): void
21
    {
22
        $expected = [
23
            ['id' => 8000],
24
            ['id' => 8001],
25
        ];
26
27
        $sql = $this->repository->getSelfAndDescendantsSubQuery(8000);
28
        $actual = _em()->getConnection()->fetchAllAssociative($sql);
29
        self::assertSame($expected, $actual);
30
    }
31
}
32