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

Files: 
CommentFileSizeAuthor
#1 drupal8.field-system.2087449-1.patch1.37 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 58,930 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.37 KB
PASSED: [[SimpleTest]]: [MySQL] 58,930 pass(es).
[ View ]

+++ 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? :)

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

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.