You are here

public function TrueFalseUnitTest::unitTestUpdateTrueFalseQuestionNode in Quiz 7.4

Same name and namespace in other branches
  1. 6.6 question_types/truefalse/truefalse.test \TrueFalseUnitTest::unitTestUpdateTrueFalseQuestionNode()
  2. 6.4 question_types/truefalse/truefalse.test \TrueFalseUnitTest::unitTestUpdateTrueFalseQuestionNode()
  3. 7 question_types/truefalse/truefalse.test \TrueFalseUnitTest::unitTestUpdateTrueFalseQuestionNode()

Test updating of a question.

1 call to TrueFalseUnitTest::unitTestUpdateTrueFalseQuestionNode()
TrueFalseUnitTest::testTrueFalseNodeOperations in question_types/truefalse/truefalse.test
Run a bundle of Node API tests.

File

question_types/truefalse/truefalse.test, line 125

Class

TrueFalseUnitTest

Code

public function unitTestUpdateTrueFalseQuestionNode() {
  $node = node_load($this->node_id);
  $new_correct_answer = !$this->correct_answer;
  $node->title = $this
    ->randomName(100);
  $node->correct_answer = $new_correct_answer;
  node_save($node);
  $nodeCopy = node_load($node->nid, $node->vid);
  $this
    ->assertEqual($nodeCopy->correct_answer, $new_correct_answer, t('Check that stored score is the same as newly assigned score.'));
}