public function LongAnswerUnitTest::unitTestGetAnswer in Quiz 6.6
Same name and namespace in other branches
- 6.3 question_types/long_answer/long_answer.test \LongAnswerUnitTest::unitTestGetAnswer()
- 6.4 question_types/long_answer/long_answer.test \LongAnswerUnitTest::unitTestGetAnswer()
- 6.5 question_types/long_answer/long_answer.test \LongAnswerUnitTest::unitTestGetAnswer()
- 7 question_types/long_answer/long_answer.test \LongAnswerUnitTest::unitTestGetAnswer()
- 7.4 question_types/long_answer/long_answer.test \LongAnswerUnitTest::unitTestGetAnswer()
File
- question_types/
long_answer/ long_answer.test, line 272 - Unit tests for the long_answer Module.
Class
- LongAnswerUnitTest
- Unit tests for the long_answer Module. @file
Code
public function unitTestGetAnswer() {
$answer = long_answer_get_answer(1, 1, 1);
$this
->assertTrue($answer !== FALSE, t('Check that an answer was returned.'));
$this
->assertEqual($answer['is_evaluated'], 1, t('Check that answer is scored.'));
$this
->assertEqual($answer['answer_id'], 1, t('Check that this is first answer'));
$this
->assertEqual($answer['answer'], 'THIS IS A TEST ANSWER', t('Check that answer text is expected.'));
}