public function testICanSetAerobicActivityDuration() { $expected = array('mon' => 50, 'tue' => 50); $this->assertEmpty(0, $this->instance->getAerobicActivityDuration()); $this->assertInstanceOf(Moving::class, $this->instance->setAerobicActivityDays($expected)); $this->assertEquals(count($expected), $this->instance->getAerobicActivityDays()); }
/** * @param Moving $moving * @param ParamFetcher $paramFetcher * @return Moving * @throws \Exception */ public function updateMoving(Moving $moving, ParamFetcher $paramFetcher) { $entityManager = $this->getEntityManager(); $moving->setAerobicActivityDays($this->normaliseDayDurationsToArray($paramFetcher, Moving::AEROBIC_PREFIX))->setStrengtheningActivityDays($this->normaliseDayDurationsToArray($paramFetcher, Moving::STRENGTH_PREFIX))->setCompletedDate(new \DateTime()); $entityManager->persist($moving); $entityManager->flush(); return $this->getQuestionnaireFromMoving($moving); }