Problem/Motivation

$loaded_entities doesn't exist in EntityReferenceFieldTest::testReferencedEntitiesMultipleLoad()

diff --git a/core/modules/system/src/Tests/Entity/EntityReferenceFieldTest.php b/core/modules/system/src/Tests/Entity/EntityReferenceFieldTest.php
index 14a67ef..4f66b4e 100644
--- a/core/modules/system/src/Tests/Entity/EntityReferenceFieldTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityReferenceFieldTest.php
@@ -170,7 +170,7 @@ public function testReferencedEntitiesMultipleLoad() {
       else {
         // A non-existent or NULL entity target id must not return any item in
         // the target entities set.
-        $this->assertFalse(isset($loaded_entities[$delta]));
+        $this->assertFalse(isset($entities[$delta]));
       }
     }
   }

Proposed resolution

Fix it.

Remaining tasks

Patch it commit it.

User interface changes

None

API changes

None

Data model changes

None.

Comments

jibran created an issue. See original summary.

jibran’s picture

Status: Active » Needs review
StatusFileSize
new1.2 KB

Here is the patch.

  • jibran committed 24db767 on 8.x-1.x
    Issue #2567291 by jibran: Fix typo in DynamicEntityReferenceFieldTest::...
jibran’s picture

Title: Fix typo in DynamicEntityReferenceFieldTest::testReferencedEntitiesMultipleLoad() » Fix typo in EntityReferenceFieldTest::testReferencedEntitiesMultipleLoad()
Project: Dynamic Entity Reference » Drupal core
Version: 8.x-1.x-dev » 8.0.x-dev
Component: Code » entity_reference.module
Issue summary: View changes
StatusFileSize
new665 bytes

eb22d21 can also be fixed for upstream.

benjy’s picture

Status: Needs review » Reviewed & tested by the community
larowlan’s picture

Can we write a test to show the failure?
Bug reports normally require a test.

benjy’s picture

a bug in a test needs a test? :)

The last submitted patch, 2: fix_typo_in-2567291-2.patch, failed testing.

The last submitted patch, 2: fix_typo_in-2567291-2.patch, failed testing.

jibran’s picture

It is just a coding typo and not an actual bug so I don't think it's worth adding tests here.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: fix_typo_in-2567291-4.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new665 bytes

reuploading

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Also, we can not add a test for a test :) Checked the context of the change in my editor and the patch is correct.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed bdc8d1e and pushed to 8.0.x. Thanks!

  • alexpott committed bdc8d1e on 8.0.x
    Issue #2567291 by jibran: Fix typo in EntityReferenceFieldTest::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.