TimeCardTest::testCreateCardTime()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Tests\ValueObject;
4
5
6
use PHPUnit\Framework\TestCase;
7
use TrelloCycleTime\ValueObject\HistoryCard;
8
use TrelloCycleTime\ValueObject\TimeCard;
9
10
class TimeCardTest extends TestCase
11
{
12
    private $cardTime;
13
    private $id;
14
    private $title;
15
    private $from;
16
    private $to;
17
    private $cardHistory;
18
19
    public function setup()
20
    {
21
        $this->id = '1';
22
        $this->title = 'title';
23
24
        $this->from = 'from';
25
        $this->to = 'to';
26
27
        $this->cardHistory = $this->prophesize(HistoryCard::class);
28
        $this->cardHistory->getFrom()->willReturn('from');
29
        $this->cardHistory->getTo()->willReturn('to');
30
31
        $this->cardTime = TimeCard::create($this->id, $this->title);
32
    }
33
34
    public function testCreateCardTime()
35
    {
36
        $this->assertEquals($this->id, $this->cardTime->getId());
37
        $this->assertEquals($this->title, $this->cardTime->getTitle());
38
        $this->assertEquals([], $this->cardTime->getCycleTimes());
39
    }
40
41
    public function testSetCycleTimeColumnsByKey()
42
    {
43
        $this->cardTime->setCycleTimesByFromAndTo('from', 'to', 100);
44
45
        $cycleTime = $this->cardTime->getCycleTimesByFromAndTo('from', 'to');
46
        $this->assertEquals(100, $cycleTime);
47
    }
48
}