Passed
Pull Request — master (#10)
by Anatoly
02:20
created

EntryManagerTest::testList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 6
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 10
rs 10
1
<?php declare(strict_types=1);
2
3
namespace App\Bundle\Example\Tests\Service;
4
5
/**
6
 * Import classes
7
 */
8
use App\Tests\ContainerAwareTrait;
9
use App\Tests\DatabaseSchemaToolTrait;
10
use PHPUnit\Framework\TestCase;
11
12
/**
13
 * EntryManagerTest
14
 */
15
class EntryManagerTest extends TestCase
16
{
17
    use ContainerAwareTrait;
18
    use DatabaseSchemaToolTrait;
19
20
    /**
21
     * @return void
22
     *
23
     * @runInSeparateProcess
24
     */
25
    public function testCountAll() : void
26
    {
27
        $container = $this->getContainer();
28
        $doctrine = $container->get('doctrine');
29
30
        $entityManager = $doctrine->getManager('slave');
31
        $this->createDatabaseSchema($entityManager);
32
33
        $entryManager = $container->get('entryManager');
34
        $this->assertSame(0, $entryManager->countAll());
35
36
        $entryManager->create(['name' => 'foo', 'slug' => 'foo']);
37
        $this->assertSame(1, $entryManager->countAll());
38
    }
39
40
    /**
41
     * @return void
42
     *
43
     * @runInSeparateProcess
44
     */
45
    public function testList() : void
46
    {
47
        $container = $this->getContainer();
48
        $doctrine = $container->get('doctrine');
49
50
        $entityManager = $doctrine->getManager('slave');
51
        $this->createDatabaseSchema($entityManager);
52
53
        $entryManager = $container->get('entryManager');
54
        $this->assertSame([], $entryManager->getList(null, null));
55
56
        // to be continued...
57
    }
58
}
59