public function MultichoiceTestCase::testAnswerSingleRestore in Quiz 7.5
Test restoring a single choice answer.
File
- question_types/
multichoice/ multichoice.test, line 158 - Test suite for choice Questions type module.
Class
- MultichoiceTestCase
- Test class for multichoice questions.
Code
public function testAnswerSingleRestore() {
// Radio buttons.
$this
->drupalLogin($this->admin);
$question_node = $this
->testCreateQuizQuestion(array(
'choice_multi' => 0,
));
$question_node2 = $this
->testCreateQuizQuestion(array(
'choice_multi' => 0,
));
$quiz_node = $this
->linkQuestionToQuiz($question_node);
$this
->linkQuestionToQuiz($question_node2, $quiz_node);
$this
->drupalLogin($this->user);
$this
->drupalGet("node/{$quiz_node->nid}/take");
$this
->drupalPost(NULL, array(
"question[{$question_node->nid}][answer][user_answer]" => 1,
), t('Next'));
$this
->drupalGet("node/{$quiz_node->nid}/take/1");
$this
->assertFieldChecked('edit-question-1-answer-user-answer-1');
}