예제 #1
0
 public function testWinner()
 {
     $match = $this->getMock('Application\\Model\\Entity\\PlannedMatch');
     $this->plannedMatch->winnerPlaysInMatchAt($match, 1);
     $this->assertEquals(1, $this->plannedMatch->getMatchIndexForWinner());
     $this->assertSame($match, $this->plannedMatch->getMatchForWinner());
 }
예제 #2
0
파일: Tournament.php 프로젝트: 0ida/fussi
 /**
  * @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());
     }
 }