You are here

function NodeHierarchyCreateParentChildTests::testCreateChildNode in Node Hierarchy 6

File

tests/nodehierarchy.test, line 100

Class

NodeHierarchyCreateParentChildTests

Code

function testCreateChildNode() {
  $parent_node = $this
    ->createParentNode();
  $child_type = $this
    ->createChildType();
  $edit['type'] = $child_type->type;
  $edit['parent'] = $parent_node->nid;
  $child_node = $this
    ->drupalCreateNode($edit);
  $child_node_load = node_load($child_node->nid);
  $this
    ->assertEqual($parent_node->nid, $child_node_load->parent, 'Child node has parent id: ' . $child_node_load->parent);
}