public function testPlayedPlannedMatchIsNotReady() { $team1 = $this->getMock('Application\\Model\\Entity\\Team'); $team2 = $this->getMock('Application\\Model\\Entity\\Team'); $this->plannedMatch->setTeam1($team1); $this->plannedMatch->setTeam2($team2); $match = $this->getMock('Application\\Model\\Entity\\DoubleMatch'); $this->plannedMatch->matchPlayed($match); $this->assertFalse($this->plannedMatch->isReady()); }
/** * @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()); } }