Completed
Push — master ( cf4527...b5dc5d )
by
unknown
01:18
created

createFromResourceNameNoMapping()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 1
Metric Value
c 4
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Managlea\Tests;
4
5
6
use Managlea\Component\EntityManagerFactoryInterface;
7
use Managlea\Component\EntityManagerInterface;
8
9
class EntityManagerFactoryTest extends BaseTestCase
10
{
11
    /**
12
     * @test
13
     * @expectedException \Exception
14
     */
15
    public function createFromResourceNameNoMapping()
16
    {
17
        $entityManagerFactory = $this->getEntityManagerFactory();
18
        $entityManagerFactory->create('foo');
19
    }
20
21
    /**
22
     * @test
23
     * @expectedException \Exception
24
     */
25
    public function createFromResourceNameNoService()
26
    {
27
        $entityManagerFactory = $this->getEntityManagerFactory();
28
        $this->assertTrue($entityManagerFactory instanceof EntityManagerFactoryInterface);
29
30
        $entityManagerFactory->create('foo');
31
    }
32
33
    /**
34
     * @test
35
     */
36
    public function createFromResourceName()
37
    {
38
        $entityManagerFactory = $this->getEntityManagerFactory();
39
        $this->assertTrue($entityManagerFactory instanceof EntityManagerFactoryInterface);
40
41
        $entityManager = $entityManagerFactory->create('doctrine_entity_manager');
42
        $this->assertTrue($entityManager instanceof EntityManagerInterface);
43
    }
44
}
45