You are here

public function ViewsAtomTestCase::vaNewNode in Views Atom 6

Creates a random new node

Parameters

$node_type: Machine name of the type of node to create

$options: Other options to apply before creating the node

Return value

object of the new node

1 call to ViewsAtomTestCase::vaNewNode()
ViewsAtomTestCase::test in tests/views_atom.test
views_atom tests

File

tests/views_atom.test, line 144
Simple tests for views_atom

Class

ViewsAtomTestCase
Tests basic set up for publishing and consuming

Code

public function vaNewNode($node_type = NULL, $options = array()) {
  $node_type = $node_type ? $node_type : $this
    ->vaRandomNodeType();
  $edit = array();
  $edit['type'] = $node_type;
  $edit['title'] = $this
    ->randomName(8);
  $edit['body'] = $this
    ->randomName(300);
  $edit['status'] = 1;
  foreach ($options as $key => $value) {
    $edit[$key] = $value;
  }
  return $this
    ->drupalCreateNode($edit);
}