FeatureTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B testModel() 0 30 1
1
<?php
2
3
namespace Developtech\AgilityBundle\Tests\Model;
4
5
use Developtech\AgilityBundle\Entity\Feature;
6
use Developtech\AgilityBundle\Entity\Project;
7
use Developtech\AgilityBundle\Tests\Mock\User;
8
9
class FeatureTest extends \PHPUnit_Framework_TestCase {
10
    public function testModel() {
11
        $feature =
12
            (new Feature())
13
            ->setId(1)
14
            ->setFeatureType(Feature::FEATURE_TYPE_USER)
15
            ->setName('Calendar')
16
            ->setSlug('calendar')
17
            ->setDescription('Calendar of all the events')
18
            ->setResponsible((new User()))
19
            ->setProject((new Project()))
20
            ->setProductOwnerValue(80)
21
            ->setUserValue(67)
22
            ->setStatus(Feature::STATUS_IN_PROGRESS)
23
            ->setCreatedAt(new \DateTime())
24
            ->setUpdatedAt(new \DateTime())
25
        ;
26
        $this->assertEquals(1, $feature->getId());
27
        $this->assertEquals(Feature::FEATURE_TYPE_USER, $feature->getFeatureType());
28
        $this->assertEquals(Feature::TYPE_FEATURE, $feature->getType());
29
        $this->assertEquals('Calendar', $feature->getName());
30
        $this->assertEquals('calendar', $feature->getSlug());
31
        $this->assertEquals('Calendar of all the events', $feature->getDescription());
32
        $this->assertInstanceOf(User::class, $feature->getResponsible());
33
        $this->assertInstanceOf(Project::class, $feature->getProject());
34
        $this->assertEquals(Feature::STATUS_IN_PROGRESS, $feature->getStatus());
35
        $this->assertEquals(80, $feature->getProductOwnerValue());
36
        $this->assertEquals(67, $feature->getUserValue());
37
        $this->assertInstanceOf('DateTime', $feature->getCreatedAt());
38
        $this->assertInstanceOf('DateTime', $feature->getUpdatedAt());
39
    }
40
}
41