Example #1
0
 /**
  * @covers YAYOG\History::addWorkout
  * @depends testAddWorkoutSetsProgramNr
  */
 public function testAddWorkoutHandlesMultipleProgramNr()
 {
     $workout1 = new Workout();
     $workout1->setProgram('Basic')->setDay(4);
     $workout2 = new Workout();
     $workout2->setProgram('Basic')->setDay(4);
     $workout3 = new Workout();
     $workout3->setProgram('Basic')->setDay(6);
     $workout4 = new Workout();
     $workout4->setProgram('1st Class')->setDay(4);
     $workouts = array($workout1, $workout2, $workout3, $workout4);
     foreach ($workouts as $workout) {
         $this->history->addWorkout($workout);
     }
     $this->assertSame(1, $workout1->getProgramNr());
     $this->assertSame(2, $workout2->getProgramNr());
     $this->assertSame(2, $workout3->getProgramNr());
     $this->assertSame(1, $workout4->getProgramNr());
 }
Example #2
0
 /**
  * @covers YAYOG\Workout::setProgramNr
  * @covers YAYOG\Workout::getProgramNr
  */
 public function testSetProgramNr()
 {
     $this->workout->setProgramNr('6');
     $this->assertSame(6, $this->workout->getProgramNr());
 }