Passed
Push — master ( 7a5018...5ee49d )
by Alessandro
01:01 queued 10s
created

CardsIdCollectionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateFromId() 0 7 1
A testCreateFromArray() 0 15 1
1
<?php
2
3
namespace Tests\Collection;
4
5
use PHPUnit\Framework\TestCase;
6
use TrelloCycleTime\Client\TrelloApiClient;
7
use TrelloCycleTime\Collection\CardsIdCollection;
8
use TrelloCycleTime\Collection\HistoryCards;
9
use TrelloCycleTime\ValueObject\CardId;
10
use TrelloCycleTime\ValueObject\HistoryCard;
11
12
class CardsIdCollectionTest extends TestCase
13
{
14
    public function testCreateFromId()
15
    {
16
        $id = 'fooId';
17
        $cardsId = CardsIdCollection::createFromId($id);
18
19
        $this->assertEquals([CardId::createFromId($id)], $cardsId->getCardsId());
20
    }
21
22
    public function testCreateFromArray()
23
    {
24
        $id = 'fooId';
25
26
        $idArray = [
27
            [
28
                'id' => $id,
29
                'foo' => 'bar'
30
            ]
31
        ];
32
33
        $cardsId = CardsIdCollection::createFromArray($idArray);
34
35
        $this->assertEquals([CardId::createFromId($id)], $cardsId->getCardsId());
36
    }
37
}
38