本文整理匯總了PHP中Survey::setSurveyName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Survey::setSurveyName方法的具體用法?PHP Survey::setSurveyName怎麽用?PHP Survey::setSurveyName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Survey
的用法示例。
在下文中一共展示了Survey::setSurveyName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testDeleteQuestionFromSurvey
public function testDeleteQuestionFromSurvey()
{
$survey = new Survey();
$survey->setSurveyName("hi");
$survey->setDescription('stuff');
$qtypes = QuestionType::toArray();
$max = rand(4, 5);
for ($i = 0; $i < $max; ++$i) {
$q = new SurveyQuestion();
$q->setType(new QuestionType(rand(1, count($qtypes))));
$q->setQuestion("q" . $i);
$survey->addQuestion($q);
}
$this->manager->createSurvey($survey);
$toDelete = $survey->getQuestions()[rand(0, $max - 1)];
$idToDelete = $toDelete->getId();
$survey->deleteQuestion($idToDelete);
$this->manager->updateSurvey($survey);
$this->assertEquals($max - 1, count($survey->getQuestions()));
}
示例2: testSurveyName
public function testSurveyName()
{
$survey = new Survey();
$survey->setSurveyName("yesno");
$survey->setDescription('stuff');
$q = new SurveyQuestion();
$q->setType(QuestionType::YesNo());
$q->setQuestion("A question");
$survey->addQuestion($q);
//add another question
$q2 = new SurveyQuestion();
$q2->setType(QuestionType::StarRating());
$secondQuestion = "Second question";
$q2->setQuestion($secondQuestion);
$survey->addQuestion($q2);
$this->surveyManager->createSurvey($survey);
SurveyEntityManager::testClear();
$service = $this->newSurveyService();
$this->request['Body'] = "yesno";
$this->request['From'] = "1234";
$serviced = $service->service();
$this->assertTrue($serviced);
$this->request['Body'] = "no";
$this->request['From'] = "1234";
$serviced = $service->service();
$this->assertTrue($serviced);
$this->assertContains($secondQuestion, $service->getResponse()->getContent());
}
示例3: testTagCloud
public function testTagCloud()
{
$survey = new Survey();
$survey->setSurveyName("hi");
$survey->setDescription('stuff');
$q = new SurveyQuestion();
$q->setType(QuestionType::Text());
$q->setQuestion("Your Suggestions");
$survey->addQuestion($q);
$this->manager->createSurvey($survey);
$max = rand(1, 20);
for ($i = 0; $i < $max; ++$i) {
$val = $this->getRandomString();
$ans = new SurveyAnswer();
$ans->setAnswer($val);
$ans->setAnsweredBy("+12064122496");
$this->manager->addAnswer($q->getId(), $ans);
}
$answers = $this->manager->getAnswers($survey->getId());
$strArr = ReportChartFormatter::getChartData($answers->getAnswers($q->getId()), ChartFormats::TagCloud());
$this->assertNotNull($strArr);
//TODO: how the heck do i test this? I guess that it just works?
}