當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。