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

CardsIdCollectionTest::testCreateFromArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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