function testDateScheme() { $scheme = new Scheme(TypeJeu::keno()); $date = \DateTime::createFromFormat('d/m/Y', '24/01/2015'); $scheme->setDraw($date, [1, 18, 43], [5]); $this->assertEquals(date('d/m/Y', $date->format('U')), $scheme->schemeDate()); $this->assertEquals($date, $scheme->getDate()); }
private function csvFileParse(array $idxNumbers, array $idxExtras) { if (!file_exists($this->csvFilePath)) { throw new \Exception("Fichier csv non trouvé à l'emplacement: " . $this->csvFilePath); } $dateCellIndex = 1; $lines = file($this->csvFilePath); while (($line = $lines[$this->distance + 1]) != null && $this->distance < 1101) { $this->csvLine = explode(";", $line); $scheme = new Scheme($this->game); $sDate = $this->csvLine[$dateCellIndex]; $scheme->setDraw(\DateTime::createFromFormat('d/m/Y', $sDate), $this->getMatchingLineNumbers($idxNumbers), $this->getMatchingLineNumbers($idxExtras)); $scheme->setDistance($this->distance); $this->schemes->add($scheme); $this->distance++; } }