当前位置: 首页>>代码示例>>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;未经允许,请勿转载。