CardHistoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateFromArray() 0 33 1
1
<?php
2
3
namespace Tests\ValueObject;
4
5
use PHPUnit\Framework\TestCase;
6
use TrelloCycleTime\ValueObject\HistoryCard;
7
8
class CardHistoryTest extends TestCase
9
{
10
    public function testCreateFromArray()
11
    {
12
        $cardId = '1000';
13
        $name = 'name';
14
        $listBefore = 'listBefore';
15
        $listAfter = 'listAfter';
16
        $date = '2019-04-29 00:00:00';
17
        
18
        $data = [
19
            'data' => [
20
                'card' => [
21
                    'id' => $cardId,
22
                    'name' => $name,
23
                ],
24
                'listBefore' => [
25
                    'name' => $listBefore,
26
                ],
27
                'listAfter' => [
28
                    'name' => $listAfter,
29
                ]
30
            ],
31
            'date' =>  $date
32
        ];
33
34
        $cardHistory = HistoryCard::createFromArray($data);
35
36
        $this->assertEquals($cardId, $cardHistory->getId());
37
        $this->assertEquals($name, $cardHistory->getTitle());
38
        $this->assertEquals($listBefore, $cardHistory->getFrom());
39
        $this->assertEquals($listAfter, $cardHistory->getTo());
40
        $this->assertEquals($date, $cardHistory->getDate());
41
42
    }
43
}