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 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_throw_exception_when_trying_to_score_for_non_existing_team() { $player = Player::withName('Natalie'); $this->shouldThrow('PingPong\\Team\\InvalidTeamException')->during('score', [SingleTeam::withPlayer($player)]); }