Esempio n. 1
0
 public function testGetPositionByTeam()
 {
     $league = new League();
     $team1 = new Team();
     $team1->setId(1);
     $team1->setPoints(1);
     $league->addTeam($team1);
     $team2 = new Team();
     $team2->setId(2);
     $team2->setPoints(3);
     $league->addTeam($team2);
     $this->assertEquals(1, $league->getPositionByTeam($team2));
     $this->assertEquals(2, $league->getPositionByTeam($team1));
 }
Esempio n. 2
0
 /**
  * @param int $season
  *
  * @throws \Exception
  */
 public function createFinalPosition($season)
 {
     $finalPosition = new FinalPosition();
     $finalPosition->setTeam($this);
     $finalPosition->setSeason($season);
     $finalPosition->setLeague($this->league);
     $finalPosition->setPosition($this->league->getPositionByTeam($this));
     $this->finalPositions->add($finalPosition);
 }