diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php index 87f0cf2..f5f74d0 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php @@ -104,6 +104,7 @@ public function testAutoCreate() { $result = $query->execute(); $this->assertTrue($result, 'Referenced node was created.'); $referenced_nid = key($result); + $referenced_node = node_load($referenced_nid); // Assert the referenced node is associated with referencing node. $result = \Drupal::entityQuery('node') @@ -114,8 +115,9 @@ public function testAutoCreate() { $referencing_node = node_load($referencing_nid); $this->assertEqual($referenced_nid, $referencing_node->test_field[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'], 'Newly created node is referenced from the referencing node.'); - // Now try to view the node. + // Now try to view the node and check that the referenced node is shown. $this->drupalGet('node/' . $referencing_node->id()); - $this->assertNoText('Exception'); + $this->assertText($referencing_node->label(), 'Referencing node label found.'); + $this->assertText($referenced_node->label(), 'Referenced node label found.'); } }