예제 #1
0
 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());
 }
예제 #2
0
파일: Pert.php 프로젝트: hardwork2015/cdp
 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);
             }
         }
     }
 }
예제 #3
0
 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());
 }