Ejemplo n.º 1
0
 /**
  * @test
  * @depends arena_tiles_can_be_returned_and_inpected
  * @depends new_game_should_contain_only_empty_tiles
  * @depends occupation_of_a_tile_on_a_rulesless_game
  * @TODO Move Method: This belongs to Neighbour test.
  */
 public function rule_of_neighbours_are_applied()
 {
     $arenaLimits = new Geometry\Cartesian\Point(4, 4);
     $rules = array('Neibor' => 'Iannsp\\PhpWar\\Game\\Score\\Neibor');
     $arena = new Arena($arenaLimits, $rules);
     $alice = 'A';
     $bob = 'B';
     $this->assertCount(1, $arena->play($alice, new Move(0, 1))->getWinners(), 'Alice should be able to move to an uncoppied tile.');
     $this->assertCount(1, $arena->play($alice, new Move(1, 1))->getWinners(), 'Alice should be able to move to an uncoppied tile.');
     $this->assertCount(1, $arena->play($alice, new Move(1, 0))->getWinners(), 'Alice should be able to move to an uncoppied tile.');
     $this->assertCount(1, $arena->play($bob, new Move(0, 0))->getLosers(), 'Bob can\'t move to an unocoppied tile where Alice is a nighbour. He got shot in tha face!');
     $this->assertCount(1, $arena->play($bob, new Move(1, 1))->getLosers(), 'Bob could occupy Alice\'s tile if it had no hostile (Alice\'s) nieghbours. He got shot in tha face, again!');
 }