Skip to content
Snippets Groups Projects
Commit 47f9d90a authored by Andrei Ivnitskii's avatar Andrei Ivnitskii Committed by Damien McKenna
Browse files

Issue #3414012 by DamienMcKenna, ivnish, sidharth_soman: Fix tests, module for...

Issue #3414012 by DamienMcKenna, ivnish, sidharth_soman: Fix tests, module for Drupal 10.2 & PHP 8.2.
parent 3c9eff94
No related branches found
No related tags found
1 merge request!7Resolve #3414012 "Fix tests, module for Drupal 10.2 & PHP 8.2"
Pipeline #196484 passed with warnings
......@@ -6,6 +6,8 @@ Advanced Views RSS Feed 8.x-2.x-dev, 202x-xx-xx
#3425960 by thatguy, edwardsay, ivnish, DamienMcKenna, misterdidi: Wrong
Content-type header for RSS Feed.
#3420191 by DamienMcKenna: Add GitLab CI test file.
#3414012 by DamienMcKenna, ivnish, sidharth_soman: Fix tests, module for Drupal
10.2 & PHP 8.2.
Advanced Views RSS Feed 8.x-2.2, 2023-09-24
......
......@@ -37,6 +37,20 @@ class RssFields extends StylePluginBase {
*/
protected $usesGrouping = FALSE;
/**
* The namespaces to add to the output.
*
* @var array
*/
public array $namespaces = [];
/**
* The channel elements present for this display.
*
* @var array
*/
public array $channel_elements = [];
/**
* {@inheritdoc}
*/
......
......@@ -16,7 +16,7 @@ dependencies:
id: test_views_rss_feed
label: 'Views RSS'
module: views
description: ''
description: 'Test view for the Advanced Views RSS Feed module.'
tag: ''
base_table: node_field_data
base_field: nid
......@@ -151,6 +151,15 @@ display:
date_format: custom
custom_date_format: r
timezone: UTC
tooltip:
date_format: ''
custom_date_format: ''
time_diff:
enabled: false
future_format: '@interval hence'
past_format: '@interval ago'
granularity: 2
refresh: 60
group_column: value
group_columns: { }
group_rows: true
......@@ -493,7 +502,6 @@ display:
- 'languages:language_interface'
- url
- url.query_args
- user
- 'user.node_grants:view'
- user.permissions
tags:
......@@ -547,13 +555,14 @@ display:
pubDate: created
display_extenders: { }
path: views-rss.xml
displays:
default: default
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- user
- 'user.node_grants:view'
- user.permissions
tags:
......
......@@ -40,6 +40,13 @@ class DisplayFeedTest extends BrowserTestBase {
*/
protected $testStartTime;
/**
* A file object for testing with.
*
* @var \Drupal\file\Entity\File
*/
protected $image;
/**
* {@inheritdoc}
*/
......@@ -90,12 +97,15 @@ class DisplayFeedTest extends BrowserTestBase {
$node2->setCreatedTime(strtotime(('-1 day')))->save();
$this->drupalGet('views-rss.xml');
$this->assertSession()->responseHeaderEquals('Content-Type', 'application/rss+xml; charset=utf-8');
$this->assertSession()->statusCodeEquals(200);
$session = $this->assertSession();
$session->responseHeaderEquals('Content-Type', 'application/rss+xml; charset=utf-8');
$this->assertEquals($node_title, $this->getSession()->getDriver()->getText('//item/title'));
$this->assertEquals($node_link, $this->getSession()->getDriver()->getText('//item/link'));
$this->assertEquals($node_link, $this->getSession()->getDriver()->getText('//item/comments'));
// Verify HTML is properly escaped in the description field.
$this->assertSession()->responseContains('<p>A paragraph</p>');
$this->assertEquals('<p>A paragraph</p>', $this->getSession()->getDriver()->getText('//item/description'));
$selector = sprintf(
'enclosure[@url="%s"][@length="%s"][@type="%s"]',
\Drupal::service('file_url_generator')->generateAbsoluteString('public://example.jpg'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment