DataFixtureTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testDataFixtureEntity() 0 10 1
1
<?php
2
3
namespace RDV\Bundle\MigrationBundle\Tests\Unit\Entity;
4
5
use RDV\Bundle\MigrationBundle\Entity\DataFixture;
6
7
class DataFixtureTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @var DataFixture
11
     */
12
    protected $dataFixtureEntity;
13
14
    protected function setUp()
15
    {
16
        $this->dataFixtureEntity = new DataFixture();
17
    }
18
19
    public function testDataFixtureEntity()
20
    {
21
        $this->assertNull($this->dataFixtureEntity->getId());
22
        $this->assertNull($this->dataFixtureEntity->getClassName());
23
        $this->dataFixtureEntity->setClassName('testClass');
24
        $this->assertEquals('testClass', $this->dataFixtureEntity->getClassName());
25
        $this->assertNull($this->dataFixtureEntity->getLoadedAt());
26
        $this->dataFixtureEntity->setLoadedAt(new \DateTime('2013-01-01'));
27
        $this->assertEquals('2013-01-01', $this->dataFixtureEntity->getLoadedAt()->format('Y-m-d'));
28
    }
29
}
30