public function ShortAnswerUnitTest::unitTestShortAnswerCreateQuestionNode in Quiz 7.4
Same name and namespace in other branches
- 6.6 question_types/short_answer/short_answer.test \ShortAnswerUnitTest::unitTestShortAnswerCreateQuestionNode()
- 6.4 question_types/short_answer/short_answer.test \ShortAnswerUnitTest::unitTestShortAnswerCreateQuestionNode()
- 7 question_types/short_answer/short_answer.test \ShortAnswerUnitTest::unitTestShortAnswerCreateQuestionNode()
1 call to ShortAnswerUnitTest::unitTestShortAnswerCreateQuestionNode()
- ShortAnswerUnitTest::testShortAnswerNodeOperations in question_types/
short_answer/ short_answer.test - Run a bundle of Node API tests.
File
- question_types/
short_answer/ short_answer.test, line 138
Class
Code
public function unitTestShortAnswerCreateQuestionNode() {
$node = $this
->createShortAnswerQuestion();
if (!$node) {
throw new Exception('Expected to have a node to work with.');
}
$this->node_id = $node->nid;
$this
->assertEqual($node->title, $this->title, t('Title of stored node should equal the original title.'));
$this
->assertEqual($node->body, $this->body, t('Body of stored node should be equal to original body.'));
$this
->assertEqual($node->type, $this->question_node_type, t('Stored node type should be long_answer'));
$this
->assertEqual($node->correct_answer, $this->correct_answer, t('Correct answer of stored node should be equal the original correct answer'));
$this
->assertEqual($node->maximum_score, $this->maximum_score, t('Maximum Score of stored node should be equal the original maximum score'));
$this
->assertEqual($node->correct_answer_evaluation, $this->correct_answer_evaluation, t('Correct answer evaluation method should be equal the correct answer'));
}