| Total Complexity | 6 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class DeckTest extends TestCase |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Construct object and verify that the deck is created with correct number of cards. |
||
| 14 | */ |
||
| 15 | public function testCreateDeck() |
||
| 16 | { |
||
| 17 | $deck = new Deck(); |
||
| 18 | $this->assertInstanceOf(Deck::class, $deck); |
||
| 19 | $this->assertEquals(52, $deck->remainingCardsCount()); |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Test DrawCard. |
||
| 24 | */ |
||
| 25 | public function testDrawCard() |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Test GetCards. |
||
| 36 | */ |
||
| 37 | public function testGetCards() |
||
| 38 | { |
||
| 39 | $deck = new Deck(); |
||
| 40 | $cards = $deck->getCards(); |
||
| 41 | |||
| 42 | // Check 4 suits |
||
| 43 | $this->assertCount(4, $cards); |
||
| 44 | |||
| 45 | foreach ($cards as $suit => $cardsInSuit) { |
||
| 46 | $this->assertCount(13, $cardsInSuit); |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Test draw all cards. |
||
| 52 | */ |
||
| 53 | public function testDrawAllCards() |
||
| 63 | } |
||
| 64 | } |
||
| 65 |