Completed
Pull Request — develop (#39)
by Axel
08:43
created

FeatureTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 31
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B testModel() 0 29 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
            ->setType('user')
15
            ->setName('Calendar')
16
            ->setSlug('calendar')
17
            ->setDescription('Calendar of all the events')
18
            ->setDeveloper((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('user', $feature->getType());
28
        $this->assertEquals('Calendar', $feature->getName());
29
        $this->assertEquals('calendar', $feature->getSlug());
30
        $this->assertEquals('Calendar of all the events', $feature->getDescription());
31
        $this->assertInstanceOf(User::class, $feature->getDeveloper());
32
        $this->assertInstanceOf(Project::class, $feature->getProject());
33
        $this->assertEquals(Feature::STATUS_IN_PROGRESS, $feature->getStatus());
34
        $this->assertEquals(80, $feature->getProductOwnerValue());
35
        $this->assertEquals(67, $feature->getUserValue());
36
        $this->assertInstanceOf(\DateTime::class, $feature->getCreatedAt());
37
        $this->assertInstanceOf(\DateTime::class, $feature->getUpdatedAt());
38
    }
39
}
40