Working on #1953408: Remove ArrayAccess BC layer from field config entities was found that cache tests are totally broken.
Thats caused that cardinality was taken from string not field, so 0 (zero) items generated

CommentFileSizeAuthor
#1 drupal8.field-system.2087449-1.patch1.37 KBandypost
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

Status: Active » Needs review
FileSize
1.37 KB
amateescu’s picture

+++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php
@@ -282,7 +282,7 @@ function testFieldAttachCache() {
     $this->assertEqual($cache->data[$this->field_name_2][$langcode], $values, 'Cached: correct cache entry on load');

How about this one?

And why is it not failing if it's broken? :)

andypost’s picture

Because $string[abrakadabra] === 0
AND FieldTestBase::_generateTestFieldValues just saves 0 to wrong field, so presence of the entity unknown

webchick’s picture

Status: Needs review » Fixed

I didn't quite parse #3 and asked andypost for more details.

In https://api.drupal.org/api/drupal/core!modules!field!lib!Drupal!field!Te... it's doing this:

 for ($i = 0; $i < $cardinality; $i++) {

Since $cardinality evaluates to 0, basically the loop is skipped.

Committed and pushed to 8.x. Thanks!

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