diff --git a/core/modules/views/src/Tests/ViewResultAssertionTrait.php b/core/modules/views/src/Tests/ViewResultAssertionTrait.php index 8ab752b..f0387ea 100644 --- a/core/modules/views/src/Tests/ViewResultAssertionTrait.php +++ b/core/modules/views/src/Tests/ViewResultAssertionTrait.php @@ -88,7 +88,6 @@ protected function assertIdenticalResultsetHelper($view, $expected_result, $colu 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,6 +95,8 @@ protected function assertIdenticalResultsetHelper($view, $expected_result, $colu if (count(explode(':', $view_column)) == 2) { $column = explode(':', $view_column)[1]; } + // 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; }