/**
  * calcul et retour du dbt de la rencontre
  * @param \AppBundle\Entity\Rencontre $rencontre
  * @return int
  */
 private function calculDBT($rencontre)
 {
     $em = $this->getContainer()->get('doctrine')->getManager();
     $p1 = $rencontre->getPays1()->getPoints();
     $p2 = $rencontre->getPays2()->getPoints();
     $diff = $em->getRepository("AppBundle:Parametre")->findOneBy(array("nom" => "diff"));
     $l = CalculPointUtility::calculL($rencontre->getLieuMatch());
     $tn = $this->calculTAnneePrecedente($rencontre->getDate());
     $dbt = CalculPointUtility::calculDBT($p1, $p2, $diff->getValeur(), $l, $tn);
     return $dbt;
 }
Example #2
0
 /**
  * Test L pour les matchs sur terrain neutre
  */
 public function testLNeutre()
 {
     $result = CalculPointUtility::calculL('2');
     $this->assertEquals(2, $result);
 }