1 entityreference.form.test protected EntityReferenceFormTestCase::postNodeFormWithEntityReference($type, $field_name, $title)

Helper method to submit node creation form.

Parameters

object $type: Node type object.

string $field_name: Name of the Entity Reference field.

string $title: The node title to enter into the Entity Reference field.

File

core/modules/entityreference/tests/entityreference.form.test, line 190
Contains EntityReferenceFormTestCase.

Class

EntityReferenceFormTestCase
Test for Entity Reference form.

Code

protected function postNodeFormWithEntityReference($type, $field_name, $title) {
  $type_path = 'node/add/' . str_replace('_', '-', $type->type);
  $edit = array(
    $field_name . '[und][0][target_id]' => $title,
  );

  $this->backdropPost($type_path, $edit, t('Save'));
}