You are here

public function TrueFalseUnitTest::unitTestCreateTrueFalseQuestionNode in Quiz 7.4

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

Create and then update a node.

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

File

question_types/truefalse/truefalse.test, line 109

Class

TrueFalseUnitTest

Code

public function unitTestCreateTrueFalseQuestionNode() {
  $node = $this
    ->createTrueFalseQuestion();

  // raise an exception if the quiz node is not created
  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 true_false'));
}