function it_finds_the_cheapest_way_to_win_a_game_with_no_decorators(Player $player, Player $opponent) { $player->getDamage()->willReturn(10); $this->addPlayer('player', $player); $this->addPlayer('opponent', $opponent); $this->cheapestWin('player')->shouldReturn(0); }
function it_plays_a_move_before_declaring_the_winner(Player $player, Player $opponent) { $opponent->isDefeated()->willReturn(false); $opponent->attack(5)->will(function () { $this->isDefeated()->willReturn(true); })->shouldBeCalled(); $opponent->getArmor()->willReturn(0); $player->getDamage()->willReturn(5); $this->addPlayer('player', $player); $this->addPlayer('opponent', $opponent); $this->playGame()->shouldReturn('player'); }