As noted by @jibran in #2064191-85: Fix the 'target_bundle' field setting - 'target_bundles' are not validated when entity_reference is enabled, EntityReferenceFieldTest::testEntityReferenceFieldValidation() contains :

    // @todo Implement a test case for invalid bundle references after
    //   https://www.drupal.org/node/2064191 is fixed.

That is already tested in other places (EntityFieldTest for example), but it makes sense to test it here.

CommentFileSizeAuthor
#2 2579411-ER_bundle_validation-1.patch1.39 KByched

Comments

yched created an issue. See original summary.

yched’s picture

Status: Active » Needs review
StatusFileSize
new1.39 KB

Patch

jibran’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Quickfix

Thanks @yched. Looks perfect.

andypost’s picture

Just a nit

+++ b/core/modules/system/src/Tests/Entity/EntityReferenceFieldTest.php
@@ -105,8 +105,14 @@ public function testEntityReferenceFieldValidation() {
+    $referenced_entity = entity_create($this->referencedEntityType, array('type' => 'non_referenceable'));

Deprecated in 8.0

yched’s picture

@andypost : that's what the rest of the test, so I kept it to preserve symmetry for people reading the test.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Aweomesauce!

Committed and pushed to 8.0.x. Thanks!

  • webchick committed f8ff417 on 8.0.x
    Issue #2579411 by yched: Resolve @todo by adding test in...

Status: Fixed » Closed (fixed)

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