EntityFactoryTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testFactoryInterface() 0 6 1
A testCreate() 0 6 1
A testCreateAssumingException() 0 5 1
1
<?php
2
3
namespace Ajir\RabbitMqSqlBundle\Tests\Factory;
4
5
use Ajir\RabbitMqSqlBundle\Factory\EntityFactory;
6
7
/**
8
 *
9
 */
10
class EntityFactoryTest extends \PHPUnit_Framework_TestCase
11
{
12
    protected $class = 'Ajir\RabbitMqSqlBundle\Model\Entity';
13
14
    /**
15
     *
16
     */
17
    public function testFactoryInterface()
18
    {
19
        $factory = new EntityFactory($this->class);
20
21
        $this->assertInstanceOf('Ajir\RabbitMqSqlBundle\Factory\EntityFactoryInterface', $factory);
22
    }
23
24
    /**
25
     *
26
     */
27
    public function testCreate()
28
    {
29
        $factory = new EntityFactory($this->class);
30
31
        $this->assertInstanceOf($this->class, $factory->create(array('_table' => 'test')));
32
    }
33
34
    /**
35
     *
36
     */
37
    public function testCreateAssumingException()
38
    {
39
        $this->setExpectedException('InvalidArgumentException');
40
        new EntityFactory('stdClass');
41
    }
42
}
43