Completed
Push — master ( cd6d5c...fa5688 )
by Axel
05:46 queued 03:12
created

FeatureModelTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

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