EntityFactoryTest::testCreateAssumingException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
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