/** * @param GameDateEvent $event */ public function execute(GameDateEvent $event) { $matches = $this->fixtureRepository->findByGameDate($event->getGameDate()); foreach ($matches as $match) { $this->lineupService->createFixtureLineup($match); $this->matchEvaluationService->evaluateCompleteMatch($match); } }
public function testPointsAndGoalsForLeague() { $team1 = $this->createTeam(1); $team2 = $this->createTeam(2); $fixture = $this->createFixture($team1, $team2); $this->assertEquals(0, $team1->getPoints()); $this->assertEquals(0, $team1->getGoalsFor()); $this->assertEquals(0, $team1->getGoalsAgainst()); $this->assertEquals(0, $team2->getPoints()); $this->assertEquals(0, $team2->getGoalsFor()); $this->assertEquals(0, $team2->getGoalsAgainst()); $this->matchEvaluationService->evaluateCompleteMatch($fixture); $this->assertEquals(1, $team1->getPoints()); $this->assertEquals(0, $team1->getGoalsFor()); $this->assertEquals(0, $team1->getGoalsAgainst()); $this->assertEquals(1, $team2->getPoints()); $this->assertEquals(0, $team2->getGoalsFor()); $this->assertEquals(0, $team2->getGoalsAgainst()); }