X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fviews%2Fsrc%2FTests%2FViewResultAssertionTrait.php;h=f0387eadb28e59024506d9e2c3dabbeda224e89a;hb=refs%2Fheads%2Fd864;hp=00501f5f0d36a0ec58e7ba253b648960562fa389;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/views/src/Tests/ViewResultAssertionTrait.php b/web/core/modules/views/src/Tests/ViewResultAssertionTrait.php index 00501f5f0..f0387eadb 100644 --- a/web/core/modules/views/src/Tests/ViewResultAssertionTrait.php +++ b/web/core/modules/views/src/Tests/ViewResultAssertionTrait.php @@ -88,7 +88,6 @@ trait ViewResultAssertionTrait { if (property_exists($value, $view_column)) { $row[$expected_column] = (string) $value->$view_column; } - // The comparison will be done on the string representation of the value. // For entity fields we don't have the raw value. Let's try to fetch it // using the entity itself. elseif (empty($value->$view_column) && isset($view->field[$expected_column]) && ($field = $view->field[$expected_column]) && $field instanceof EntityField) { @@ -96,7 +95,10 @@ trait ViewResultAssertionTrait { if (count(explode(':', $view_column)) == 2) { $column = explode(':', $view_column)[1]; } - $row[$expected_column] = $field->getValue($value, $column); + // The comparison will be done on the string representation of the + // value. + $field_value = $field->getValue($value, $column); + $row[$expected_column] = is_array($field_value) ? array_map('strval', $field_value) : (string) $field_value; } } $result[$key] = $row;