Esempio n. 1
0
 /**
  * Is card with $figure in collection
  *
  * @param string $figure
  * @return bool
  */
 public function hasCardWithFigure(string $figure) : bool
 {
     Card::checkFigureIsCorrect($figure);
     foreach ($this->cards as $card) {
         if ($card->getFigure() === $figure) {
             return true;
         }
     }
     return false;
 }
Esempio n. 2
0
 public function testCheckFigureIsCorrect()
 {
     foreach (FigureInterface::FIGURES as $figure) {
         Card::checkFigureIsCorrect($figure);
         $this->addToAssertionCount(1);
     }
     $expectedException = CardException::incorrectFigure('notExistedFigure');
     $this->expectException(get_class($expectedException));
     $this->expectExceptionMessage($expectedException->getMessage());
     Card::checkFigureIsCorrect('notExistedFigure');
 }