diff --git a/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php b/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php new file mode 100644 index 0000000..f66e11c --- /dev/null +++ b/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php @@ -0,0 +1,58 @@ +drupalCreateNode(); + } + + $admin_user = $this->drupalCreateUser(array('access administration pages', 'bypass node access')); + $this->drupalLogin($admin_user); + $this->drupalGet('test-entity-operations'); + + /* @var $node \Drupal\node\NodeInterface */ + foreach ($nodes as $node) { + $operations = \Drupal::entityManager()->getListBuilder('node')->getOperations($node); + foreach ($operations as $operation) { + $result = $this->xpath('//ul[contains(@class, dropbutton)]/li/a[contains(@href, :path) and text()=:title]', array(':path' => $operation['url']->getInternalPath(), ':title' => $operation['title'])); + $this->assertEqual(count($result), 1, t('Found node @operation link.', array('@operation' => $operation['title']))); + } + } + } + +} diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_operations.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_operations.yml new file mode 100644 index 0000000..0eeb8a5 --- /dev/null +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_operations.yml @@ -0,0 +1,194 @@ +langcode: und +status: true +dependencies: + module: + - node + - user +id: test_entity_operations +label: test_entity_operations +title: test_entity_operations +module: views +description: '' +tag: '' +base_table: node +base_field: nid +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: null + display_options: + access: + type: perm + cache: + type: none + query: + type: views_query + exposed_form: + type: basic + pager: + type: full + options: + items_per_page: 10 + style: + type: default + row: + type: fields + fields: + nid: + id: nid + table: node + field: nid + plugin_id: node + relationship: none + group_type: group + admin_label: '' + label: Nid + exclude: true + 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: '' + 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 + link_to_node: false + entity_type: node + entity_field: nid + title: + id: title + table: node_field_data + field: title + plugin_id: node + label: '' + alter: + alter_text: false + make_link: false + absolute: false + trim: false + word_boundary: false + ellipsis: false + strip_tags: false + html: false + hide_empty: false + empty_zero: false + link_to_node: true + entity_type: node + entity_field: title + operations: + id: operations + table: node + field: operations + relationship: none + group_type: group + admin_label: '' + label: Operations + 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: '' + 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 + destination: true + plugin_id: entity_operations + filters: + status: + value: true + table: node_field_data + field: status + id: status + plugin_id: boolean + expose: + operator: '0' + group: 1 + entity_type: node + entity_field: status + sorts: + created: + id: created + table: node_field_data + field: created + order: DESC + plugin_id: date + entity_type: node + entity_field: created + title: test_dropbutton + field_langcode: '***LANGUAGE_language_content***' + field_langcode_add_to_query: null + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: null + display_options: + path: test-entity-operations + field_langcode: '***LANGUAGE_language_content***' + field_langcode_add_to_query: null