You are here

function form_test_two_instances in Drupal 7

Menu callback that returns two instances of the node form.

1 string reference to 'form_test_two_instances'
form_test_menu in modules/simpletest/tests/form_test.module
Implements hook_menu().

File

modules/simpletest/tests/form_test.module, line 1921
Helper module for the form API tests.

Code

function form_test_two_instances() {
  global $user;
  $node1 = (object) array(
    'uid' => $user->uid,
    'name' => isset($user->name) ? $user->name : '',
    'type' => 'page',
    'language' => LANGUAGE_NONE,
  );
  $node2 = clone $node1;
  $return['node_form_1'] = drupal_get_form('page_node_form', $node1);
  $return['node_form_2'] = drupal_get_form('page_node_form', $node2);
  return $return;
}