public function testIsFinished()
 {
     $fixture = $this->createFixture($this->createTeam(1), $this->createTeam(2));
     $this->assertFalse($fixture->isFinished());
     $this->matchEvaluationService->evaluateMinuteOfMatch($fixture);
     $this->assertFalse($fixture->isFinished());
     $this->matchEvaluationService->evaluateCompleteMatch($fixture);
     $this->assertTrue($fixture->isFinished());
 }
示例#2
0
 public function testZeroScoreAfterMatchStart()
 {
     $fixture = new Fixture();
     $team1 = new Team();
     $team1->setId(1);
     $team1->addPlayer(new Player());
     $team2 = new Team();
     $team2->setId(2);
     $team2->addPlayer(new Player());
     $fixture->setTeamHome($team1);
     $fixture->setTeamAway($team2);
     $matchEvaluationService = new MatchEvaluationService();
     $matchEvaluationService->evaluateMinuteOfMatch($fixture);
     $this->assertNotNull($fixture->getScoreHome());
     $this->assertNotNull($fixture->getScoreAway());
 }