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


PHP Entity\Questionnaire类代码示例

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


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

示例1: testSpecificationIsTrue

 public function testSpecificationIsTrue()
 {
     $questionnaire = new Questionnaire(new Person());
     $drinks = $questionnaire->getDrinking()->getWeekdayDrinks()->setBeerCiderBottleAmount(1);
     $questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWhichDaysDoYouDrink('mon, tues')->setBingingFrequency(Drinking::BINGE_NEVER)->setWeekdayDrinks($drinks);
     $this->assertTrue(DrinkingLTE2DaysLTE3UnitsSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:DrinkingLTE2DaysLTE3UnitsSpecificationTest.php

示例2: testSpecificationIsTrue

 public function testSpecificationIsTrue()
 {
     $questionnaire = new Questionnaire((new Person())->setGender(Person::GENDER_MALE));
     $drinks = $questionnaire->getDrinking()->getWeekdayDrinks()->setBeerCiderBottleAmount(2);
     $questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWhichDaysDoYouDrink('mon, tues, wed, thur')->setBingingFrequency(Drinking::BINGE_NEVER)->setWeekdayDrinks($drinks);
     $this->assertTrue(DrinkingBetween3And5DaysWithinSuggestedLimitsSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:DrinkingBetween3And5DaysWithinSuggestedLimitsSpecificationTest.php

示例3: testSpecificationIsTrue

 public function testSpecificationIsTrue()
 {
     $days = array('mon' => 80, 'tues' => 80);
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getMoving()->setAerobicActivityDays($days);
     $this->assertTrue(AmberMovingAmberAerobicLowDaysRedStrengthSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:AmberMovingAmberAerobicLowDaysRedStrengthSpecificationTest.php

示例4: testSpecificationIsFalse

 public function testSpecificationIsFalse()
 {
     $questionnaire = new Questionnaire((new Person())->setGender(Person::GENDER_FEMALE));
     $questionnaire->getDrinking()->setWhichDaysDoYouDrink('mon');
     $questionnaire->getDrinking()->getWeekdayDrinks()->setSpiritsAmount(8);
     $this->assertFalse(DrinkingDoesNotExceedDailyLimitsForGenderSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:DrinkingDoesNotExceedDailyLimitsForGenderSpecificationTest.php

示例5: testSpecificationIsFalseAndIAmMale

 public function testSpecificationIsFalseAndIAmMale()
 {
     $questionnaire = new Questionnaire((new Person())->setGender(Person::GENDER_MALE));
     $drinks = (new Drinks())->setBeerCiderPintAmount(3);
     $questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWhichDaysDoYouDrink('mon, tue, wed')->setWeekdayDrinks($drinks);
     $this->assertFalse(DrinkingUnitsInLowerRiskForGenderSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:DrinkingUnitsInLowerRiskForGenderSpecificationTest.php

示例6: testSpecificationIsTrue

 public function testSpecificationIsTrue()
 {
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getDrinking()->setWhichDaysDoYouDrink('sat, sun');
     $questionnaire->getDrinking()->getWeekendDrinks()->setBeerCiderPintAmount(2);
     $this->assertTrue(DrinkingExceedsThreeUnitsSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:DrinkingExceedsThreeUnitsSpecificationTest.php

示例7: testCreateQuestionnaire

 public function testCreateQuestionnaire()
 {
     $this->createQuestionnaire();
     $this->assertNotNull($this->result);
     $this->assertStringStartsWith('FIRST_NAME ', $this->result->getPerson()->getFirstName());
     $this->assertNotEmpty($this->result->getId());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:QuestionnaireRepositoryFunctionalTest.php

示例8: calculateScore

 /**
  * @inheritdoc
  */
 public function calculateScore(Questionnaire $questionnaire)
 {
     if ($questionnaire->getMoving()->isCompleted()) {
         $this->extractMovingScore($questionnaire);
     }
     return $this->getRag();
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:10,代码来源:MovingScore.php

示例9: extractResultsNarrative

 /**
  * @param Questionnaire $questionnaire
  * @param TranslatorInterface $translator
  * @return array
  */
 public static function extractResultsNarrative(Questionnaire $questionnaire, TranslatorInterface $translator)
 {
     if (true === $questionnaire->isCompleted()) {
         self::prepareResultsNarrative($questionnaire, $translator);
     }
     return self::$resultsNarrative;
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:12,代码来源:ResultsNarrativeHelper.php

示例10: testSpecificationIsTrue

 public function testSpecificationIsTrue()
 {
     $days = array('mon' => 30, 'tues' => 30, 'wed' => 30);
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getMoving()->setAerobicActivityDays($days);
     $this->assertTrue(AerobicTimeLT150MinsDaysGTE3Specification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:AerobicTimeLT150MinsDaysGTE3SpecificationTest.php

示例11: addSignedInCompletedRecords

 /**
  * @param Questionnaire $questionnaire
  * @param Document      $document
  */
 protected function addSignedInCompletedRecords(Questionnaire $questionnaire, Document &$document)
 {
     if (true === $questionnaire->isCompleted() && true === $questionnaire->getPerson()->isSignedUp()) {
         $document->addRecord(new Record($questionnaire, $this->getContainer()->get('translator')));
     }
     $this->updateQuestionnaireAddressAndStatus($questionnaire);
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:11,代码来源:CSVExporterCommand.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: 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

示例15: populateAddressDetailsFromPostCode

 /**
  * @param Questionnaire $questionnaire
  * @return Questionnaire
  */
 public function populateAddressDetailsFromPostCode(Questionnaire $questionnaire)
 {
     $address = $questionnaire->getPerson()->getAddress();
     if ($this->hasPostCode($address) && $this->loadAuthorityForPostCode($address)) {
         $questionnaire->getPerson()->setAddress($address);
     }
     return $questionnaire;
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:12,代码来源:PopulateLocationMetaDataService.php


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