You are here

public function ScaleTestCase::testCreateQuizQuestion in Quiz 7.5

Same name and namespace in other branches
  1. 8.6 question_types/quiz_scale/quiz_scale.test \ScaleTestCase::testCreateQuizQuestion()
  2. 8.5 question_types/quiz_scale/quiz_scale.test \ScaleTestCase::testCreateQuizQuestion()
  3. 7.6 question_types/scale/scale.test \ScaleTestCase::testCreateQuizQuestion()

Create a new question with default settings.

Overrides QuizQuestionTestCase::testCreateQuizQuestion

2 calls to ScaleTestCase::testCreateQuizQuestion()
ScaleTestCase::testEditQuestionResponse in question_types/scale/scale.test
Test that the question response can be edited.
ScaleTestCase::testTakeQuestion in question_types/scale/scale.test

File

question_types/scale/scale.test, line 39
Test suite for scale question type module.

Class

ScaleTestCase
Test class for scale questions.

Code

public function testCreateQuizQuestion() {

  // Login as our privileged user.
  $this
    ->drupalLogin($this->admin);
  $settings = array();
  $settings['type'] = 'scale';
  $question_node = $this
    ->drupalCreateNode(array(
    'type' => 'scale',
    'title' => 'Scale 1 title',
    'alternative0' => 'This is alternative 1',
    'alternative1' => 'This is alternative 2',
    'alternative2' => 'This is alternative 3',
    'alternative3' => 'This is alternative 4',
    'alternative4' => 'This is alternative 5',
    'body' => array(
      LANGUAGE_NONE => array(
        array(
          'value' => 'Scale 1 body text',
        ),
      ),
    ),
  ));
  return $question_node;
}