當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Questionnaire::setMoving方法代碼示例

本文整理匯總了PHP中TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire::setMoving方法的典型用法代碼示例。如果您正苦於以下問題:PHP Questionnaire::setMoving方法的具體用法?PHP Questionnaire::setMoving怎麽用?PHP Questionnaire::setMoving使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire的用法示例。


在下文中一共展示了Questionnaire::setMoving方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testGetSetMoving

 public function testGetSetMoving()
 {
     $expected = new Moving($this->instance);
     $this->assertNotEmpty($this->instance->getMoving());
     $this->assertTrue($this->instance->setMoving($expected) instanceof Questionnaire);
     $this->assertEquals($expected, $this->instance->getMoving());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:7,代碼來源:QuestionnaireTest.php

示例2: testIHave150MinutesAnd3OrMoreDaysIAmAerobicGreen

 public function testIHave150MinutesAnd3OrMoreDaysIAmAerobicGreen()
 {
     $aerobic = array('mon' => 50, 'tue' => 50, 'wed' => 50);
     $questionnaire = new Questionnaire(new Person());
     $moving = $questionnaire->getMoving();
     $moving->setAerobicActivityDays($aerobic)->setCompletedDate(new \DateTime());
     $questionnaire->setMoving($moving);
     $this->assertTrue(AerobicIsGreenSpecification::isSatisfiedBy($questionnaire));
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:9,代碼來源:AerobicIsGreenSpecificationTest.php

示例3: testIHaveLessThan60MinutesAndLessThanThreeDaysIAmAerobicRed

 public function testIHaveLessThan60MinutesAndLessThanThreeDaysIAmAerobicRed()
 {
     $aerobic = array('mon' => 15, 'tue' => 15);
     $questionnaire = new Questionnaire(new Person());
     $moving = $questionnaire->getMoving();
     $moving->setAerobicActivityDays($aerobic)->setCompletedDate(new \DateTime());
     $questionnaire->setMoving($moving);
     $this->assertTrue(AerobicIsRedSpecification::isSatisfiedBy($questionnaire));
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:9,代碼來源:AerobicIsRedSpecificationTest.php

示例4: testIHave60OrMoreMinutesAndLessThanTwoDaysIAmAerobicAmber

 public function testIHave60OrMoreMinutesAndLessThanTwoDaysIAmAerobicAmber()
 {
     $aerobic = array('mon' => 50, 'wed' => 40);
     $questionnaire = new Questionnaire(new Person());
     $moving = $questionnaire->getMoving();
     $moving->setAerobicActivityDays($aerobic)->setCompletedDate(new \DateTime());
     $questionnaire->setMoving($moving);
     $this->assertFalse(AerobicIsGreenSpecification::isSatisfiedBy($questionnaire));
     $this->assertFalse(AerobicIsRedSpecification::isSatisfiedBy($questionnaire));
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:10,代碼來源:AerobicIsAmberFunctionalTest.php

示例5: testIGetARedRagWhenISmoke

 public function testIGetARedRagWhenISmoke()
 {
     $person = new Person();
     $person->setGender('female');
     $questionnaire = new Questionnaire($person);
     $drinking = $questionnaire->getDrinking();
     $drinking->setWeekendDrinks(new Drinks())->setWeekdayDrinks(new Drinks())->setCompletedDate(new \DateTime());
     $questionnaire->setDrinking($drinking);
     $questionnaire->getSmoking()->setCompletedDate(new \DateTime());
     $moving = $questionnaire->getMoving();
     $movingArray = array('mon' => 50, 'tue' => 50, 'wed' => 50);
     $moving->setAerobicActivityDays($movingArray)->setStrengtheningActivityDays($movingArray)->setCompletedDate(new \DateTime());
     $questionnaire->setMoving($moving);
     $questionnaire->getEating()->setCompletedDate(new \DateTime());
     $questionnaire->getSmoking()->setDoYouSmoke('yes')->setCompletedDate(new \DateTime());
     $expected = array('value' => QuestionnaireScore::SCORE_RED, 'rag' => QuestionnaireScore::RAG_RED, 'normalized_score' => QuestionnaireScore::RED_CUTOFF);
     $this->assertEquals($expected, $this->instance->calculateScore($questionnaire));
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:18,代碼來源:QuestionnaireScoreTest.php

示例6: testIGetGreenWithExactCutoffs

 /**
  * 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']);
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:16,代碼來源:MovingScoreTest.php


注:本文中的TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire::setMoving方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。