當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Survey::setSurveyName方法代碼示例

本文整理匯總了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()));
 }
開發者ID:sarhanm,項目名稱:sms-survey,代碼行數:20,代碼來源:SurveyManagerTest.php

示例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());
 }
開發者ID:sarhanm,項目名稱:sms-survey,代碼行數:28,代碼來源:SurveyServiceTest.php

示例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?
 }
開發者ID:sarhanm,項目名稱:sms-survey,代碼行數:23,代碼來源:AnswerChartFormatterTest.php


注:本文中的Survey::setSurveyName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。