function let() { $this->playerTommy = Player::withName('Tommy'); $this->playerDanny = Player::withName('Danny'); $this->teamOne = SingleTeam::withPlayer($this->playerTommy); $this->teamTwo = SingleTeam::withPlayer($this->playerDanny); $this->beConstructedThrough('withTeams', array($this->teamOne, $this->teamTwo)); }
function let() { $this->player = Player::withName('Tommy'); $this->spectator = Player::withName('Mathieu'); $this->beConstructedThrough('withPlayer', [$this->player]); }
function it_should_throw_exception_when_trying_to_score_for_non_existing_team() { $player = Player::withName('Natalie'); $this->shouldThrow('PingPong\\Team\\InvalidTeamException')->during('score', [SingleTeam::withPlayer($player)]); }
function it_should_throw_exception_if_setting_non_existing_team() { $player = Player::withName('Natalie'); $this->shouldThrow('PingPong\\Team\\InvalidTeamException')->during('setServingTeam', [SingleTeam::withPlayer($player)]); }
function it_should_not_be_possible_to_set_an_unknown_player_as_serving_member() { $player = Player::withName('Thomas'); $this->shouldThrow('PingPong\\Player\\InvalidPlayerException')->during('setServingPlayer', array($player)); }