/** * @param PlannedMatch $plannedMatch * @param Match $match */ public function matchPlayed(Match $match, PlannedMatch $plannedMatch = null) { $plannedMatch->matchPlayed($match); $winner = $plannedMatch->getTeam($match->getWinner() - 1); if ($plannedMatch->isFinal()) { $this->winner = $winner; $second = $plannedMatch->getTeam($match->getLooser() - 1); $this->second = $second; $this->end = new \DateTime(); } else { $plannedMatch->getMatchForWinner()->setTeam($winner, $plannedMatch->getMatchIndexForWinner()); } }
/** * @expectedException RuntimeException */ public function testGetTeamByInvalidIndex() { $this->plannedMatch->getTeam(2); }