EntityManagerFactoryTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 8
Bugs 4 Features 2
Metric Value
wmc 3
c 8
b 4
f 2
lcom 1
cbo 2
dl 0
loc 36
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createFromResourceNameNoMapping() 0 5 1
A createFromResourceNameNoService() 0 7 1
A createFromResourceName() 0 8 1
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