public function QuizFileUploadTestCase::testCreateQuizQuestion in Quiz File Upload 7.5
Test the creation of a file upload question.
3 calls to QuizFileUploadTestCase::testCreateQuizQuestion()
- QuizFileUploadTestCase::testAutomaticallyGradeAnswer in tests/
quizfileupload.test - Test automatically graded questions.
- QuizFileUploadTestCase::testFilesizeValidation in tests/
quizfileupload.test - Test filesize validation.
- QuizFileUploadTestCase::testGradeAnswerManualFeedback in tests/
quizfileupload.test - Test manually graded questions.
File
- tests/
quizfileupload.test, line 43 - Unit tests for the quizfileupload Module.
Class
- QuizFileUploadTestCase
- Test class for the file upload question type.
Code
public function testCreateQuizQuestion($settings = array()) {
if (!$settings) {
$settings = array(
'filetypes' => QUIZFILEUPLOAD_DEFAULT_EXTENSIONS,
'correct_answer_evaluation' => QuizfileuploadQuestion::ANSWER_MATCH,
);
}
// Login as our privileged user.
$this
->drupalLogin($this->admin);
$question_node = $this
->drupalCreateNode(array(
'type' => $this->question_node_type,
'title' => 'SA 1 title',
'body' => array(
LANGUAGE_NONE => array(
array(
'value' => 'SA 1 body text.',
),
),
),
) + $settings);
return $question_node;
}