CardGraphicTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetAsString() 0 7 1
A testCreateCardGraphic() 0 6 1
1
<?php
2
3
namespace App\Card;
4
5
use PHPUnit\Framework\TestCase;
6
7
/**
8
 * Test cases for class CardGraphic.
9
 */
10
class CardGraphicTest extends TestCase
11
{
12
    /**
13
     * Construct object and verify that the object has the expected
14
     * properties.
15
     */
16
    public function testCreateCardGraphic()
17
    {
18
        $cardGraphic = new CardGraphic('Hearts', 'King');
19
        $this->assertInstanceOf(CardGraphic::class, $cardGraphic);
20
        $this->assertEquals('Hearts', $cardGraphic->getSuit());
21
        $this->assertEquals('King', $cardGraphic->getValue());
22
    }
23
24
    /**
25
     * Test getAsString.
26
     */
27
    public function testGetAsString()
28
    {
29
        $cardHearts = new CardGraphic('Hearts', '10');
30
        $cardSpades = new CardGraphic('Spades', 'Ace');
31
32
        $this->assertEquals('♥10', $cardHearts->getAsString());
33
        $this->assertEquals('♠Ace', $cardSpades->getAsString());
34
    }
35
}
36