Completed
Push — master ( 3c7dc9...bd8e6e )
by Jonas
01:52
created

EntityManagerFactoryTest::testIfInvokable()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 29
rs 8.8571
cc 1
eloc 20
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of SteamScore.
7
 *
8
 * (c) SteamScore <[email protected]>
9
 *
10
 * This Source Code Form is subject to the terms of the Mozilla Public
11
 * License, v. 2.0. If a copy of the MPL was not distributed with this
12
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
13
 */
14
15
namespace SteamScore\Api\Tests\Domain\Factories;
16
17
use Doctrine\ORM\EntityManagerInterface;
18
use Interop\Container\ContainerInterface;
19
use PHPUnit\Framework\TestCase;
20
use SteamScore\Api\Domain\Factories\EntityManagerFactory;
21
22
/**
23
 * @coversDefaultClass EntityManagerFactory
24
 */
25
class EntityManagerFactoryTest extends TestCase
26
{
27
    /**
28
     * Tests that the factory is invokable.
29
     */
30
    public function testIfInvokable()
31
    {
32
        $container = $this->prophesize(ContainerInterface::class);
33
        $factory = new EntityManagerFactory();
34
35
        $container->get('config')->willReturn([
36
            'debug' => false,
37
            'orm' => [
38
                'connection' => [
39
                    'charset' => 'utf8mb4',
40
                    'collate' => 'utf8mb4_unicode_ci',
41
                    'dbname' => 'steamscore',
42
                    'driver' => 'mysqli',
43
                    'host' => 'localhost',
44
                    'password' => '',
45
                    'port' => 3306,
46
                    'user' => 'root',
47
                ],
48
                'mapping' => [
49
                    'data/orm' => 'SteamScore\Api\Domain\Entities',
50
                ],
51
                'proxies' => 'data/proxies',
52
            ],
53
        ]);
54
55
        $instance = $factory($container->reveal());
56
57
        $this->assertInstanceOf(EntityManagerInterface::class, $instance);
58
    }
59
}
60