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

FeatureModelTest::testModel()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 27
rs 8.8571
cc 1
eloc 25
nc 1
nop 0
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