diff --git a/tests/module/simple_gmap_stress_test/config/install/core.entity_form_display.node.simple_gmap_stress_test.default.yml b/tests/module/simple_gmap_stress_test/config/install/core.entity_form_display.node.simple_gmap_stress_test.default.yml new file mode 100644 index 0000000..b1378ef --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/core.entity_form_display.node.simple_gmap_stress_test.default.yml @@ -0,0 +1,91 @@ +uuid: acdfe773-c815-454d-b520-bbdf5a7ed473 +langcode: en +status: true +dependencies: + config: + - field.field.node.simple_gmap_stress_test.field_map1 + - field.field.node.simple_gmap_stress_test.field_map2 + - field.field.node.simple_gmap_stress_test.field_xss + - node.type.simple_gmap_stress_test + module: + - path +id: node.simple_gmap_stress_test.default +targetEntityType: node +bundle: simple_gmap_stress_test +mode: default +content: + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_map1: + weight: 121 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_map2: + weight: 122 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_xss: + weight: 123 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + path: + type: path + weight: 30 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + settings: + display_label: true + weight: 15 + region: content + third_party_settings: { } + status: + type: boolean_checkbox + settings: + display_label: true + weight: 120 + region: content + third_party_settings: { } + sticky: + type: boolean_checkbox + settings: + display_label: true + weight: 16 + region: content + third_party_settings: { } + title: + type: string_textfield + weight: -5 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 5 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + region: content + third_party_settings: { } +hidden: { } diff --git a/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.default.yml b/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.default.yml new file mode 100644 index 0000000..f0a5525 --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.default.yml @@ -0,0 +1,80 @@ +uuid: 56138ea6-7df8-445f-8fe9-44b86e65e71e +langcode: en +status: true +dependencies: + config: + - field.field.node.simple_gmap_stress_test.field_map1 + - field.field.node.simple_gmap_stress_test.field_map2 + - field.field.node.simple_gmap_stress_test.field_xss + - node.type.simple_gmap_stress_test + module: + - simple_gmap + - user +id: node.simple_gmap_stress_test.default +targetEntityType: node +bundle: simple_gmap_stress_test +mode: default +content: + field_map1: + weight: 101 + label: above + settings: + include_map: true + include_static_map: true + apikey: 'Static maps will not work unless you put in a key' + iframe_width: '200' + iframe_height: '200' + static_scale: 1 + link_text: 'View larger map' + zoom_level: 14 + map_type: m + langcode: en + include_link: false + include_text: false + third_party_settings: { } + type: simple_gmap + region: content + field_map2: + weight: 102 + label: above + settings: + include_map: true + include_static_map: true + apikey: 'Static maps will not work unless you put in a key' + iframe_width: '200' + iframe_height: '200' + static_scale: 1 + link_text: 'View larger map' + zoom_level: 5 + include_text: true + map_type: k + langcode: en + include_link: false + third_party_settings: { } + type: simple_gmap + region: content + field_xss: + weight: 103 + label: above + settings: + include_map: true + include_static_map: true + apikey: '' + iframe_width: '200' + iframe_height: '200' + static_scale: 1 + include_link: true + link_text: 'View larger map' + zoom_level: 14 + map_type: m + langcode: en + include_text: false + third_party_settings: { } + type: simple_gmap + region: content + links: + weight: 100 + region: content + settings: { } + third_party_settings: { } +hidden: { } diff --git a/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.teaser.yml b/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.teaser.yml new file mode 100644 index 0000000..5a4d183 --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.teaser.yml @@ -0,0 +1,18 @@ +uuid: f5d4434b-9f05-402c-8a8a-a7eb0f10b4d8 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - node.type.simple_gmap_stress_test + module: + - user +id: node.simple_gmap_stress_test.teaser +targetEntityType: node +bundle: simple_gmap_stress_test +mode: teaser +content: + links: + weight: 100 + region: content +hidden: { } diff --git a/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_map1.yml b/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_map1.yml new file mode 100644 index 0000000..3fd28d6 --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_map1.yml @@ -0,0 +1,21 @@ +uuid: 74825356-64da-4f38-8ebd-3451e09cb2d3 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_map1 + - node.type.simple_gmap_stress_test +id: node.simple_gmap_stress_test.field_map1 +field_name: field_map1 +entity_type: node +bundle: simple_gmap_stress_test +label: map1 +description: 'Expect to see a location in Paris.' +required: true +translatable: false +default_value: + - + value: 'Eiffel Tower' +default_value_callback: '' +settings: { } +field_type: string diff --git a/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_map2.yml b/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_map2.yml new file mode 100644 index 0000000..488bc59 --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_map2.yml @@ -0,0 +1,21 @@ +uuid: 9ec89da2-070b-4bdf-9c3d-72a603d89e5b +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_map2 + - node.type.simple_gmap_stress_test +id: node.simple_gmap_stress_test.field_map2 +field_name: field_map2 +entity_type: node +bundle: simple_gmap_stress_test +label: map2 +description: 'A view in Quebec. Demonstrates a complex character set.' +required: true +translatable: false +default_value: + - + value: 'Place de l'Université-du-Québec, boulevard Charest Est, Québec, QC G1K' +default_value_callback: '' +settings: { } +field_type: string diff --git a/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_xss.yml b/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_xss.yml new file mode 100644 index 0000000..beb42c8 --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_xss.yml @@ -0,0 +1,21 @@ +uuid: e5a33bb0-5699-46c8-bad7-196d1fc0d7ef +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_xss + - node.type.simple_gmap_stress_test +id: node.simple_gmap_stress_test.field_xss +field_name: field_xss +entity_type: node +bundle: simple_gmap_stress_test +label: xss +description: 'This field demonstrates the rejection of a XSS attack.' +required: true +translatable: false +default_value: + - + value: ' Empire State Building' +default_value_callback: '' +settings: { } +field_type: string diff --git a/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_map1.yml b/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_map1.yml new file mode 100644 index 0000000..5b54d90 --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_map1.yml @@ -0,0 +1,21 @@ +uuid: ed08abe4-2bfe-4d64-89da-d8794ff1535d +langcode: en +status: true +dependencies: + module: + - node +id: node.field_map1 +field_name: field_map1 +entity_type: node +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_map2.yml b/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_map2.yml new file mode 100644 index 0000000..498d20f --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_map2.yml @@ -0,0 +1,21 @@ +uuid: 5bb62b53-fea7-4b4d-9057-67734296670b +langcode: en +status: true +dependencies: + module: + - node +id: node.field_map2 +field_name: field_map2 +entity_type: node +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_xss.yml b/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_xss.yml new file mode 100644 index 0000000..84bce0c --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_xss.yml @@ -0,0 +1,21 @@ +uuid: 581bfa0f-d8f4-413b-8cd8-a2d048a67d35 +langcode: en +status: true +dependencies: + module: + - node +id: node.field_xss +field_name: field_xss +entity_type: node +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/tests/module/simple_gmap_stress_test/config/install/node.type.simple_gmap_stress_test.yml b/tests/module/simple_gmap_stress_test/config/install/node.type.simple_gmap_stress_test.yml new file mode 100644 index 0000000..caf2ce8 --- /dev/null +++ b/tests/module/simple_gmap_stress_test/config/install/node.type.simple_gmap_stress_test.yml @@ -0,0 +1,18 @@ +uuid: 39d6d049-a8c5-4f7a-b2da-92ad2661f2ee +langcode: en +status: true +dependencies: + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'simple gmap stress test' +type: simple_gmap_stress_test +description: 'A series of field configured to utilize the simple gmap formatter. Each field test a different aspect of the formatter.' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: true diff --git a/tests/module/simple_gmap_stress_test/stress_test.info.yml b/tests/module/simple_gmap_stress_test/stress_test.info.yml new file mode 100644 index 0000000..114db32 --- /dev/null +++ b/tests/module/simple_gmap_stress_test/stress_test.info.yml @@ -0,0 +1,7 @@ +name: simple_gmap_stress_test +type: module +description: 'Provides a stress_test content entity.' +package: Custom +core: 8.x +dependencies: + - simple_gmap diff --git a/tests/src/Functional/StressTest.php b/tests/src/Functional/StressTest.php new file mode 100644 index 0000000..92235a8 --- /dev/null +++ b/tests/src/Functional/StressTest.php @@ -0,0 +1,63 @@ +drupalCreateUser([ + 'access content', + 'edit any page content', + ]); + $this->drupalLogin($auth_user); + + // Create a stress test node with three fields where the default values + // will exercise the formater. + $this->node = NodeType::create([ + 'type' => 'simple_gmap_stress_test', + 'title' => 'A three field node', + ]); + $this->node->save(); + } + + /** + * Tests the access to the flag checkbox in the node edit form. + */ + public function testCheckboxAccess() { + // Get the node edit form. + $this->drupalGet("node/" . $this->node->id()); + + $this->assertSession()->pageTextContains('XYZ', 'The field was as expected..'); + } + +}