Ejemplo n.º 1
0
 /**
  * @test
  * @depends arena_tiles_can_be_returned_and_inpected
  * @depends new_game_should_contain_only_empty_tiles
  * @depends position_already_occupied_is_neutralized_when_other_player_tried_to_occupy_it
  */
 public function rule_of_hit_is_applied_allowing_an_occupied_tile_to_be_taken_by_another_player()
 {
     $arenaLimits = new Geometry\Cartesian\Point(4, 4);
     $rules = array('Hit' => 'Iannsp\\PhpWar\\Game\\Score\\Hit');
     $arena = new Arena($arenaLimits, $rules);
     $move = new Move(0, 1);
     $alice = 'A';
     $bob = 'B';
     $arena->play($alice, $move);
     $tiles = $arena->getArena();
     $this->assertEquals($alice, $tiles[0][1], 'Alice moved to that tile, so it should be hers.');
     $arena->play($bob, $move);
     $tiles = $arena->getArena();
     $this->assertEquals('.', $tiles[0][1], 'Bob moved to the tile occipied by Alice, therefore it is neutralized now.');
 }