Пример #1
0
 public function testResetPointsAndGoals()
 {
     $this->team->setPoints(1);
     $this->team->setGoalsFor(1);
     $this->team->setGoalsAgainst(1);
     $this->team->resetPointsAndGoals();
     $this->assertEquals(0, $this->team->getPoints());
     $this->assertEquals(0, $this->team->getGoalsFor());
     $this->assertEquals(0, $this->team->getGoalsAgainst());
 }
Пример #2
0
 public function testStandingsWithGoalsFor()
 {
     $league = new League();
     $team1 = new Team();
     $team1->setId(1);
     $team1->setPoints(1);
     $team1->setGoalsFor(5);
     $team1->setGoalsAgainst(3);
     $league->addTeam($team1);
     $team2 = new Team();
     $team2->setId(2);
     $team2->setPoints(1);
     $team2->setGoalsFor(6);
     $team2->setGoalsAgainst(4);
     $league->addTeam($team2);
     $this->assertTrue($league->getTeamByPosition(1)->equals($team2));
     $this->assertTrue($league->getTeamByPosition(2)->equals($team1));
 }