Commit ee96b11e authored by WalkingDexter's avatar WalkingDexter Committed by atymchuk

Several functional tests [2].

parent 3c735970
langcode: en
status: true
dependencies:
module:
- node
- user
id: simple_sitemap_views_test_view
label: 'Test view'
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: none
options:
items_per_page: null
offset: 0
style:
type: default
row:
type: fields
options:
default_field_elements: true
inline: { }
separator: ''
hide_empty: false
fields:
title:
id: title
table: node_field_data
field: title
entity_type: node
entity_field: title
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
settings:
link_to_entity: true
plugin_id: field
relationship: none
group_type: group
admin_label: ''
exclude: 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_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: '1'
table: node_field_data
field: status
plugin_id: boolean
entity_type: node
entity_field: status
id: status
expose:
operator: ''
group: 1
sorts: { }
title: 'Test view'
header: { }
footer: { }
empty: { }
relationships: { }
arguments:
type:
id: type
table: node_field_data
field: type
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: false
validate:
type: none
fail: 'not found'
validate_options: { }
glossary: false
limit: 0
case: none
path_case: none
transform_dash: false
break_phrase: false
entity_type: node
entity_field: type
plugin_id: node_type
title:
id: title
table: node_field_data
field: title
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: false
validate:
type: none
fail: 'not found'
validate_options: { }
glossary: false
limit: 0
case: none
path_case: none
transform_dash: false
break_phrase: false
entity_type: node
entity_field: title
plugin_id: string
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- 'user.node_grants:view'
- user.permissions
tags: { }
page_1:
display_plugin: page
id: page_1
display_title: Page
position: 1
display_options:
display_extenders:
simple_sitemap_display_extender:
index: true
variant: default
priority: '0.5'
changefreq: ''
arguments:
type: type
max_links: 100
path: simple-sitemap-views-test-view
rendering_language: en
cache_metadata:
max-age: -1
contexts:
- 'languages:language_interface'
- url
- 'user.node_grants:view'
- user.permissions
tags: { }
name: 'Simple XML Sitemap (Views) Test'
type: module
description: 'Test module for Simple XML Sitemap (Views).'
package: Testing
core: 8.x
dependencies:
- simple_sitemap:simple_sitemap_views
......@@ -36,4 +36,27 @@ class SimpleSitemapViewsTest extends SimpleSitemapViewsTestBase {
$this->assertTrue($this->sitemapViews->isEnabled());
}
/**
* Tests indexable views.
*/
public function testIndexableViews() {
// Ensure that at least one indexable view exists.
$indexable_views = $this->sitemapViews->getIndexableViews();
$this->assertNotEmpty($indexable_views);
$test_view = NULL;
foreach ($indexable_views as &$view) {
if ($view->id() == 'simple_sitemap_views_test_view' && $view->current_display == 'page_1') {
$test_view = $view;
break;
}
}
// The test view should be in the list.
$this->assertNotNull($test_view);
// Check the indexing status of the argument.
$indexable_arguments = $this->sitemapViews->getIndexableArguments($test_view);
$this->assertContains('type', $indexable_arguments);
}
}
......@@ -17,7 +17,10 @@ abstract class SimpleSitemapViewsTestBase extends SimplesitemapTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['simple_sitemap_views'];
public static $modules = [
'simple_sitemap_views',
'simple_sitemap_views_test',
];
/**
* Views sitemap data.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment