You are here

public function CerCrudTest::testExplicitReferenceCreation in Corresponding Entity References 7.2

File

tests/crud.test, line 89

Class

CerCrudTest

Code

public function testExplicitReferenceCreation() {
  $uid = $this
    ->drupalCreateNode()->uid;
  $node = $this
    ->drupalCreateNode(array(
    'type' => 'page',
  ));
  $node->field_user['und'][0]['target_id'] = $uid;
  node_save($node);
  $account = user_load($uid, TRUE);
  $this
    ->assertEqual($account->field_node['und'][0]['target_id'], $node->nid, 'Creating an explicit reference between to unrelated entities creates a corresponding reference.', 'CER');
}