View source
<?php
class QCollectionUnitTest extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => t('Question importing unit test'),
'description' => t('Test importing of questions in various formats.'),
'group' => t('Quiz'),
);
}
function setUp() {
parent::setUp('taxonomy', 'quiz', 'views', 'autoload', 'multichoice', 'quiz_directions', 'quiz_question', 'querypath', 'questions_import', 'short_answer', 'truefalse', 'long_answer', 'matching', 'questions_export');
$user = $this
->drupalCreateUser(array(
'administer site configuration',
'access administration pages',
'administer quiz',
'access quiz',
'administer blocks',
'import_questions',
'create quiz',
'administer quiz configuration',
'use PHP for block visibility',
'administer blocks',
'create multichoice',
'edit any multichoice',
'administer taxonomy',
'allow multiple correct answers',
'allow any number of answers',
'export_questions',
));
$this
->drupalLogin($user);
$quiz_settings = array();
$quiz_settings['title'] = $this
->randomName(128);
$quiz_settings['comment'] = $this
->randomName(256);
$quiz_settings['type'] = 'quiz';
$this
->drupalCreateNode($quiz_settings);
}
}