Пример #1
0
 public function testShipIsHit()
 {
     $ship = new Ship(3);
     $ship->addCoordinate(new Point(1, 2));
     $ship->addCoordinate(new Point(2, 2));
     $ship->addCoordinate(new Point(3, 2));
     // Hit ship once
     $ship->receiveShot(2, 2);
     $this->assertTrue($ship->anyHits());
 }