/**
  * Cutoff is 3 days of 10+ minutes with a min total of 150 minutes for aerobic
  * 2 days of 30+ minutes for strength
  */
 public function testIGetGreenWithExactCutoffs()
 {
     $aerobic = array('mon' => 50, 'tue' => 50, 'wed' => 50);
     $strength = array('mon' => 30, 'tue' => 30);
     $questionnaire = new Questionnaire(new Person());
     $moving = $questionnaire->getMoving();
     $moving->setAerobicActivityDays($aerobic)->setStrengtheningActivityDays($strength)->setCompletedDate(new \DateTime());
     $questionnaire->setMoving($moving);
     $result = $this->instance->calculateScore($questionnaire);
     $this->assertEquals(MovingScore::SCORE_GREEN, $result['value']);
     $this->assertEquals(MovingScore::RAG_GREEN, $result['rag']);
 }
Exemplo n.º 2
0
 /**
  * @JMS\VirtualProperty
  * @JMS\SerializedName("rag_score")
  * @JMS\Groups({"results"})
  * @return array
  */
 public function getRagScore()
 {
     $scoring = new MovingScore();
     return $scoring->calculateScore($this->questionnaire);
 }