コード例 #1
0
ファイル: PlayerTest.php プロジェクト: delboy1978uk/casino
 /**
  * Check tests are working
  */
 public function testAddAndRemoveAndGetCards()
 {
     $card = new Card('H', 'A');
     $this->player->addCard($card);
     $this->assertEquals(1, count($this->player->getCards()));
     $card = new Card('H', 'K');
     $this->player->addCard($card);
     $this->assertEquals(2, count($this->player->getCards()));
     $card = new Card('H', 'Q');
     $this->player->addCard($card);
     $this->assertEquals(3, count($this->player->getCards()));
     $this->assertInstanceOf('Del\\Casino\\PlayingCards\\Card', $this->player->removeCard('QH'));
     $this->assertEquals(2, count($this->player->getCards()));
     //try and remove non existant card
     $this->assertFalse($this->player->removeCard('JH'));
     $this->assertEquals(2, count($this->player->getCards()));
 }