diff --git a/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block3.yml b/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block3.yml new file mode 100644 index 0000000..8a44d42 --- /dev/null +++ b/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block3.yml @@ -0,0 +1,218 @@ +langcode: en +status: true +dependencies: + module: + - node + - user +id: test_view_block3 +label: test_view_block3 +module: views +description: '' +tag: '' +base_table: node_field_data +base_field: nid +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + display_options: + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + query: + type: views_query + options: + disable_sql_rewrite: false + distinct: false + replica: false + query_comment: '' + query_tags: { } + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: some + options: + items_per_page: 5 + offset: 0 + style: + type: default + row: + type: fields + fields: + title: + id: title + table: node_field_data + field: title + settings: + link_to_entity: true + plugin_id: field + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + filters: + status: + value: true + table: node_field_data + field: status + plugin_id: boolean + entity_type: node + entity_field: status + id: status + expose: + operator: '' + group: 1 + sorts: + created: + id: created + table: node_field_data + field: created + order: DESC + entity_type: node + entity_field: created + plugin_id: date + relationship: none + group_type: group + admin_label: '' + exposed: false + expose: + label: '' + granularity: second + title: test_view_block3 + header: { } + footer: { } + empty: { } + relationships: { } + arguments: + nid: + id: nid + table: node + field: nid + relationship: none + group_type: group + admin_label: '' + default_action: ignore + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: fixed + default_argument_options: + argument: '' + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + items_per_page: 25 + override: false + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: true + validate: + type: 'entity:node' + fail: 'not found' + validate_options: + operation: view + multiple: 0 + bundles: { } + access: false + break_phrase: false + not: false + entity_type: node + entity_field: nid + plugin_id: numeric + display_extenders: { } + cache_metadata: + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - 'user.node_grants:view' + - user.permissions + cacheable: false + block_1: + display_plugin: block + id: block_1 + display_title: Block + position: 1 + display_options: + display_extenders: { } + cache_metadata: + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - 'user.node_grants:view' + - user.permissions + cacheable: false diff --git a/core/modules/views/src/Tests/Plugin/ContextualFiltersBlockContextTest.php b/core/modules/views/src/Tests/Plugin/ContextualFiltersBlockContextTest.php new file mode 100644 index 0000000..33d11ad --- /dev/null +++ b/core/modules/views/src/Tests/Plugin/ContextualFiltersBlockContextTest.php @@ -0,0 +1,65 @@ +enableViewsTestModule(); + } + + /** + * Tests exposed context. + */ + public function testBlockContext() { + + $this->drupalLogin($this->drupalCreateUser(array('administer views', 'administer blocks'))); + $this->drupalGet('admin/structure/block'); + $this->clickLinkPartialName('Place block'); + $this->drupalPlaceBlock('views_block:test_view_block3-block_1', array('label' => 'test_view_block3-block_1:1')); + + $definition = \Drupal::service('plugin.manager.block')->getDefinition('views_block:test_view_block3-block_1'); + + $this->assertTrue($definition['context']['nid']); + + } + +}