本文整理汇总了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());
}
示例8: calculateScore
/**
* @inheritdoc
*/
public function calculateScore(Questionnaire $questionnaire)
{
if ($questionnaire->getMoving()->isCompleted()) {
$this->extractMovingScore($questionnaire);
}
return $this->getRag();
}
示例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;
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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;
}