当前位置: 首页>>代码示例>>PHP>>正文


PHP Questionnaire::getAboutYou方法代码示例

本文整理汇总了PHP中TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire::getAboutYou方法的典型用法代码示例。如果您正苦于以下问题:PHP Questionnaire::getAboutYou方法的具体用法?PHP Questionnaire::getAboutYou怎么用?PHP Questionnaire::getAboutYou使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire的用法示例。


在下文中一共展示了Questionnaire::getAboutYou方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetSetAboutYou

 public function testGetSetAboutYou()
 {
     $expected = new AboutYou($this->instance);
     $this->assertNotEmpty($this->instance->getAboutYou());
     $this->assertTrue($this->instance->setAboutYou($expected) instanceof Questionnaire);
     $this->assertEquals($expected, $this->instance->getAboutYou());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:QuestionnaireTest.php

示例2: testExtractMotivations

 public function testExtractMotivations()
 {
     $expectedKeys = array("motivationsWeight", "motivationsEnergy", "motivationsBodyPain", "motivationsFeelYounger", "motivationsIndependence", "motivationsAlertness", "motivationsSocialLife", "motivationsAppearance", "motivationsFamily", "motivationsCompleted");
     $export = HowAreYouHelper::extractMotivations($this->instance->getAboutYou()->getMotivations());
     foreach ($expectedKeys as $key) {
         $this->assertArrayHasKey($key, $export);
     }
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:8,代码来源:HowAreYouHelperTest.php

示例3: testSpecificationReturnsTrue

 public function testSpecificationReturnsTrue()
 {
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getAboutYou()->getDependants()->setCompletedDate(new \DateTime());
     $questionnaire->getAboutYou()->getHindrances()->setCompletedDate(new \DateTime());
     $questionnaire->getAboutYou()->getFeelings()->setCompletedDate(new \DateTime());
     $questionnaire->getAboutYou()->getMotivations()->setCompletedDate(new \DateTime());
     $this->assertTrue($this->instance->isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:9,代码来源:AboutYouSpecificationTest.php

示例4: testIGetARedNarrative

 public function testIGetARedNarrative()
 {
     $expectedNarrative = array('about_you' => array("about_you_red", "who_depends_on_you_red", "about_you_hindrance_red_none", "about_you_red_closing"));
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getAboutYou()->getHindrances()->setNotRelevant(true)->setCompletedDate(new \DateTime());
     $questionnaire->getAboutYou()->getMotivations()->setCompletedDate(new \DateTime());
     $questionnaire->getAboutYou()->getDependants()->setPets(true)->setCompletedDate(new \DateTime());
     $questionnaire->getAboutYou()->getFeelings()->setEnergy(10)->setMood(10)->setWeight(10)->setCompletedDate(new \DateTime());
     $narrative = $this->instance->buildNarrative($questionnaire);
     $this->assertEquals($expectedNarrative, $narrative->getMessages());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:11,代码来源:AboutYouNarrativeBuilderTest.php

示例5: generateFemaleOption

 /**
  * @inheritdoc
  */
 protected function generateFemaleOption()
 {
     $person = new Person();
     $person->setGender(Person::GENDER_FEMALE)->setFirstName('Patti')->setLastName('Cline')->setAge(65);
     $questionnaire = new Questionnaire($person);
     $questionnaire->setDateCreated($this->creationDate)->getAboutYou()->getFeelings()->setEnergy(100)->setWeight(60)->setMood(75)->setFatigue(10)->setFitness(10)->setStress(25)->setCompletedDate($this->creationDate);
     $questionnaire->getAboutYou()->getHindrances()->setNotRelevant(true)->setCompletedDate($this->creationDate);
     $questionnaire->getAboutYou()->getMotivations()->setAppearance(true)->setCompletedDate($this->creationDate);
     $questionnaire->getAboutYou()->getDependants()->setGrandChildren(true)->setCompletedDate($this->creationDate);
     return $questionnaire;
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:14,代码来源:Load20PercentCompletionFixtures.php

示例6: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('male')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setEnergy(100)->setFatigue(100)->setMood(100)->setFitness(100)->setStress(100)->setWeight(80)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('water')->setBreakfastChoice('other')->setCheeseChoice('other')->setProteinChoice('5')->setFruitAndVegChoice('5')->setPotatoesChoice('other')->setDailySnackChoice('')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('yes')->setCompletedDate(new \DateTime());
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DO_NOT_DRINK)->setWhichDaysDoYouDrink('mon, tue, wed, thur, fri, sat, sun')->setCompletedDate(new \DateTime());
     $moving = array('mon' => 30, 'tue' => 30, 'wed' => 30, 'thur' => 30, 'fri' => 30, 'sat' => 30, 'sun' => 30);
     $this->questionnaire->getMoving()->setAerobicActivityDays($moving)->setStrengtheningActivityDays($moving)->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:14,代码来源:IGetARedRagAndScoreOfThreeBecauseISmokeTest.php

示例7: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('male')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setEnergy(100)->setFatigue(100)->setMood(100)->setFitness(100)->setStress(100)->setWeight(35)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('water')->setBreakfastChoice('other')->setCheeseChoice('other')->setProteinChoice('5')->setFruitAndVegChoice('5')->setPotatoesChoice('other')->setDailySnackChoice('')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('no')->setCompletedDate(new \DateTime());
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DRINK_TWO_TO_FOUR_TIMES_A_MONTH)->setBingingFrequency(Drinking::BINGE_L_T_MONTHLY)->setCompletedDate(new \DateTime());
     $moving = array('mon' => 30, 'wed' => 30, 'fri' => 30, 'sun' => 30);
     $this->questionnaire->getMoving()->setAerobicActivityDays($moving)->setStrengtheningActivityDays($moving)->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:14,代码来源:IGetAGreenNarrativeWithAScoreOfEightTest.php

示例8: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('male')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setEnergy(30)->setFatigue(30)->setMood(30)->setFitness(30)->setStress(30)->setWeight(0)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('water')->setBreakfastChoice('other')->setCheeseChoice('other')->setProteinChoice('5')->setFruitAndVegChoice('5')->setPotatoesChoice('other')->setDailySnackChoice('')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('no')->setCompletedDate(new \DateTime());
     $drinks = new Drinks();
     $drinks->setBeerCiderPintAmount(2);
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWeekdayDrinks($drinks)->setWeekendDrinks($drinks)->setWhichDaysDoYouDrink('mon,  wed, fri, sun')->setCompletedDate(new \DateTime());
     $this->questionnaire->getMoving()->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:15,代码来源:IGetAnAmberNarrativeWithAScoreOfSevenTest.php

示例9: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('female')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setEnergy(100)->setFatigue(100)->setMood(100)->setFitness(100)->setStress(100)->setWeight(35)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('sugary drink')->setBreakfastChoice('sugary cereal')->setCheeseChoice('hard cheese')->setProteinChoice('ham')->setFruitAndVegChoice('0')->setPotatoesChoice('chips')->setDailySnackChoice('sweets, crisps, cake, biscuits')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('no')->setCompletedDate(new \DateTime());
     $drinks = (new Drinks())->setBeerCiderPintAmount(5)->setBeerCiderBottleAmount(5);
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWhichDaysDoYouDrink('thur, fri, sat')->setWeekendDrinks($drinks)->setWeekdayDrinks($drinks)->setCompletedDate(new \DateTime());
     $moving = array('mon' => 40, 'tue' => 40, 'wed' => 40, 'sun' => 40);
     $this->questionnaire->getMoving()->setAerobicActivityDays($moving)->setStrengtheningActivityDays($moving)->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:15,代码来源:IGetAnAmberNarrativeWithAScoreOfFiveTest.php

示例10: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('female')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setWeight(0)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('sugary drink')->setBreakfastChoice('sugary cereals')->setCheeseChoice('hard cheese')->setProteinChoice('ham')->setFruitAndVegChoice('0')->setPotatoesChoice('chips')->setDailySnackChoice('cake, biscuits, crisps, sweets')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('yes')->setCompletedDate(new \DateTime());
     $drinks = new Drinks();
     $drinks->setBeerCiderPintAmount(5)->setWineAmount(3)->setSpiritsAmount(5)->setCompletedDate(new \DateTime());
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWhichDaysDoYouDrink('mon, tue, wed, thur, fri, sat, sun')->setWeekendDrinks($drinks)->setWeekdayDrinks($drinks)->setCompletedDate(new \DateTime());
     $this->questionnaire->getMoving()->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:15,代码来源:IGetARedNarrativeWithAScoreOfOneTest.php

示例11: testIGetARedMessageWithFitnessQuestionForMoving

 public function testIGetARedMessageWithFitnessQuestionForMoving()
 {
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getMoving()->setCompletedDate(new \DateTime());
     $questionnaire->getAboutYou()->getFeelings()->setFitness(21);
     $expected = array('moving' => array('moving_red', 'moving_red_low_fitness'));
     $this->assertEquals($expected, $this->instance->buildNarrative($questionnaire)->getMessages());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:8,代码来源:MovingNarrativeBuilderTest.php

示例12: testICanGetAPositiveNarrativeAfterQuitting

 public function testICanGetAPositiveNarrativeAfterQuitting()
 {
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getAboutYou()->getFeelings()->setEnergy(100)->setMood(20);
     $questionnaire->getSmoking()->setDoYouSmoke('quit')->setCompletedDate(new \DateTime());
     $expected = array('smoking' => array('smoking_green_quit'));
     $this->assertEquals($expected, $this->instance->buildNarrative($questionnaire)->getMessages());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:8,代码来源:SmokingNarrativeBuilderTest.php

示例13: testIGetARedMessageWithSnacksWarningEating

 public function testIGetARedMessageWithSnacksWarningEating()
 {
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getEating()->setProteinChoice('ham')->setCheeseChoice('hard cheese')->setPotatoesChoice('chips')->setDailySnackChoice('sweets, crisps, biscuits, cake')->setCompletedDate(new \DateTime());
     $questionnaire->getAboutYou()->getFeelings()->setWeight(25);
     $expected = array('eating' => array('eating_red', 'eating_red_low_weight'));
     $this->assertEquals($expected, $this->instance->buildNarrative($questionnaire)->getMessages());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:8,代码来源:EatingNarrativeBuilderTest.php

示例14: buildRedSmokingBehaviours

 /**
  * @param Questionnaire $questionnaire
  */
 protected function buildRedSmokingBehaviours(Questionnaire $questionnaire)
 {
     $symptom = SymptomGenerator::generateRelatedSymptom($questionnaire->getAboutYou()->getFeelings()->getNormalisedValues());
     if (SmokingIsOccasionalSpecification::isSatisfiedBy($questionnaire)) {
         $this->getMessageForOccasionalSmoker($questionnaire->getAboutYou()->getFeelings()->getNormalisedValues()[$symptom], $symptom);
     } else {
         $this->getMessageForSmoker($questionnaire->getAboutYou()->getFeelings()->getNormalisedValues()[$symptom], $symptom);
     }
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:12,代码来源:SmokingNarrativeBuilder.php

示例15: testICanExcludeAndGetTheSameSymptom

 public function testICanExcludeAndGetTheSameSymptom()
 {
     $questionnaire = new Questionnaire(new Person());
     $possibles = $questionnaire->getAboutYou()->getFeelings()->getNormalisedValues();
     $exclusions = array_keys($possibles);
     array_shift($exclusions);
     $expected = array_keys($possibles)[0];
     $this->assertEquals($expected, SymptomGenerator::generateRelatedSymptom($possibles, $exclusions));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:9,代码来源:SymptomGeneratorTest.php


注:本文中的TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire::getAboutYou方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。