public function testICanSetADuration()
 {
     $duration = new DayDuration('mon');
     $duration->setDuration(150);
     $this->assertInstanceOf(MovingDuration::class, $this->instance->setDuration($duration));
     $values = $this->instance->getDurations();
     $this->assertEquals($duration->getDuration(), $values['mon']);
 }
 /**
  * @param DayDuration $dayDuration
  * @return MovingDuration
  */
 public function setDuration(DayDuration $dayDuration)
 {
     $this->durations[$dayDuration->getDay()] = $dayDuration->getDuration();
     return $this;
 }
Exemplo n.º 3
0
 /**
  * @param array $strengtheningActivityDays
  * @return Moving
  */
 public function setStrengtheningActivityDays(array $strengtheningActivityDays)
 {
     foreach ($strengtheningActivityDays as $key => $val) {
         $dayDuration = new DayDuration($key);
         $this->strengtheningDayDurations->setDuration($dayDuration->setDuration($val));
     }
     return $this;
 }
 /**
  * @expectedException \LogicException
  */
 public function testWhenIUseAnInvalidDayIGetAnException()
 {
     $expected = 'madeUpDay';
     $this->assertNotEquals($expected, $this->instance->getDay());
     $this->assertInstanceOf(DayDuration::class, $this->instance->setDay($expected));
 }