GraphicCardTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
dl 0
loc 22
c 1
b 0
f 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateCard() 0 4 1
A testGetCard() 0 6 1
1
<?php
2
3
namespace App\Model;
4
5
use PHPUnit\Framework\TestCase;
6
7
/**
8
 * Test cases for class GrahicCard.
9
 */
10
class GraphicCardTest extends TestCase
11
{
12
    /**
13
     * Construct object and verify that the object is of the expected
14
     * type.
15
     */
16
    public function testCreateCard(): void
17
    {
18
        $card = new GraphicCard("hearts", "ace", 1, "🂱", 14);
19
        $this->assertInstanceOf("\App\Model\GraphicCard", $card);
20
    }
21
22
    /**
23
     * Assert that a card returns the correct details.
24
     */
25
26
    public function testGetCard(): void
27
    {
28
        $card = new GraphicCard("hearts", "ace", 1, "🂱", 14);
29
        $res = $card->getCard();
30
        $exp = ["hearts", "ace", 1, 14, "🂱"];
31
        $this->assertEquals($exp, $res);
32
    }
33
}
34