diff --git a/core/modules/views/src/Tests/ViewsEscapingTest.php b/core/modules/views/src/Tests/ViewsEscapingTest.php index bf6cf4b..ae59ffd 100644 --- a/core/modules/views/src/Tests/ViewsEscapingTest.php +++ b/core/modules/views/src/Tests/ViewsEscapingTest.php @@ -55,6 +55,11 @@ public function testViewsViewFieldsEscaping() { $this->assertEqual($this->config('system.theme')->get('default'), 'views_test_theme'); $this->drupalGet('test_page_display_200'); + + // Assert that we are using the correct template + $this->assertText('force', 'The force is strong with this one'); + + // Assert that there are no escaped '<'s $this->assertNoEscaped('<'); } diff --git a/core/modules/views/tests/themes/views_test_theme/templates/views-view-fields.html.twig b/core/modules/views/tests/themes/views_test_theme/templates/views-view-fields.html.twig index 034ac9b..6cba562 100644 --- a/core/modules/views/tests/themes/views_test_theme/templates/views-view-fields.html.twig +++ b/core/modules/views/tests/themes/views_test_theme/templates/views-view-fields.html.twig @@ -4,47 +4,7 @@ * Theme override to display all the fields in a views row. * * This exists because by default the one provided by Views is not used. - * - * Available variables: - * - view: The view in use. - * - fields: A list of fields, each one contains: - * - content: The output of the field. - * - raw: The raw data for the field, if it exists. This is NOT output safe. - * - class: The safe class ID to use. - * - handler: The Views field handler controlling this field. - * - inline: Whether or not the field should be inline. - * - wrapper_element: An HTML element for a wrapper. - * - wrapper_attributes: List of attributes for wrapper element. - * - separator: An optional separator that may appear before a field. - * - label: The field's label text. - * - label_element: An HTML element for a label wrapper. - * - label_attributes: List of attributes for label wrapper. - * - label_suffix: Colon after the label. - * - element_type: An HTML element for the field content. - * - element_attributes: List of attributes for HTML element for field content. - * - row: The raw result from the query, with all data it fetched. - * - * @see template_preprocess_views_view_fields() */ #} -{% for field in fields -%} - {{ field.separator }} - {%- if field.wrapper_element -%} - <{{ field.wrapper_element }}{{ field.wrapper_attributes }}> - {%- endif %} - {%- if field.label -%} - {%- if field.label_element -%} - <{{ field.label_element }}{{ field.label_attributes }}>{{ field.label }}{{ field.label_suffix }} - {%- else -%} - {{ field.label }}{{ field.label_suffix }} - {%- endif %} - {%- endif %} - {%- if field.element_type -%} - <{{ field.element_type }}{{ field.element_attributes }}>{{ field.content }} - {%- else -%} - {{ field.content }} - {%- endif %} - {%- if field.wrapper_element -%} - - {%- endif %} -{%- endfor %} +{% include '@views/views-view-fields.html.twig' %} +May the force be with you! \ No newline at end of file