CardGraphicTest::testGetAsString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
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