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']);
 }
예제 #2
0
 /**
  * @JMS\VirtualProperty
  * @JMS\SerializedName("strengthening_activity_days")
  * @JMS\Groups({"api_response"})
  * @return int
  */
 public function getStrengtheningActivityDays()
 {
     $total = 0;
     foreach ($this->strengtheningDayDurations->getDurations() as $key => $value) {
         if ($value >= self::STRENGTH_CUTOFF_MINUTES) {
             $total++;
         }
     }
     return $total;
 }