You are here

function NodeConvertTestCase::testSimpleNodeConvert in Node Convert 6

Same name and namespace in other branches
  1. 7 node_convert.test \NodeConvertTestCase::testSimpleNodeConvert()

File

./node_convert.test, line 42
Node convert Simpletest Unit

Class

NodeConvertTestCase
@file Node convert Simpletest Unit

Code

function testSimpleNodeConvert() {
  $type1_name = $this
    ->randomName(4);
  $type2_name = $this
    ->randomName(4);
  $type1 = $this
    ->drupalCreateContentType(array(
    'type' => $type1_name,
    'name' => $type1_name,
  ));
  $type2 = $this
    ->drupalCreateContentType(array(
    'type' => $type2_name,
    'name' => $type2_name,
  ));
  $edit['type'] = $type1_name;
  $node = $this
    ->drupalCreateNode($edit);
  node_convert_node_convert($node->nid, $type2_name, array(), array(), TRUE);
  $result = db_result(db_query("SELECT type FROM {node} WHERE nid = %d", $node->nid));
  $this
    ->assertEqual($result, $type2_name, t("Simple node conversion passed."));
}