public function testUpdate() { $sprint1 = Sprint::create(['StartDate' => '2015-11-10', 'EndDate' => '2015-11-16', 'project_id' => '1']); ${$sprint1}->update(['StartDate' => '2015-11-17', 'EndDate' => '2015-11-25', 'project_id' => '1']); $this->assertEquals('2015-11-10', $sprint1->StartDate); $this->assertEquals('2015-11-16', $sprint1->EndDate); $this->assertEquals(1, Tache::all()->count()); }
public function calculateAuPlusTard($etat, $arc) { $taches = Tache::all(); foreach ($taches as $tache) { $duree[$tache->code] = abs(strtotime($tache->start_date) - strtotime($tache->end_date)) / 60 / 60 / 24; } if ($arc->isReel()) { if ($arc->getDestination()->getAuPlusTard() - $duree[$arc->getTache()->code] < $etat->getAuPlusTard() || $etat->getAuPlusTard() == -1) { $etat->setAuPlusTard($arc->getDestination()->getAuPlusTard() - $duree[$arc->getTache()->code]); } for ($i = 1; $i <= count($this->getArcReals()); $i++) { $arc = $this->getArcReals()[$i]; if ($arc->getDestination() == $etat) { $this->calculateAuPlusTard($arc->getSource(), $arc); } } } }
public function testAdd() { $us1 = Userstory::create(['description' => 'this is a user story of our project', 'priority' => '20', 'difficulty' => '1', 'status' => 'validated', 'project_id' => '1']); $us2 = Userstory::create(['description' => 'yes client this is a user story for your satisfaction', 'priority' => '5', 'difficulty' => '1', 'status' => 'validated', 'project_id' => '1']); $this->assertEquals(2, Tache::all()->count()); }