Loading core/modules/taxonomy/tests/src/Functional/RssTest.php +15 −20 Original line number Diff line number Diff line Loading @@ -86,27 +86,23 @@ public function testTaxonomyRss() { // Create two taxonomy terms. $term1 = $this->createTerm($this->vocabulary); // RSS display must be added manually. $this->drupalGet("admin/structure/types/manage/article/display"); $edit = [ "display_modes_custom[rss]" => '1', ]; $this->submitForm($edit, 'Save'); // Add the RSS display. $default_display = $this->container->get('entity_display.repository')->getViewDisplay('node', 'article'); $rss_display = $default_display->createCopy('rss'); $rss_display->save(); // Change the format to 'RSS category'. $this->drupalGet("admin/structure/types/manage/article/display/rss"); $edit = [ "fields[taxonomy_" . $this->vocabulary->id() . "][type]" => 'entity_reference_rss_category', "fields[taxonomy_" . $this->vocabulary->id() . "][region]" => 'content', ]; $this->submitForm($edit, 'Save'); // Post an article. $edit = []; $edit['title[0][value]'] = $this->randomMachineName(); $edit[$this->fieldName . '[]'] = $term1->id(); $this->drupalGet('node/add/article'); $this->submitForm($edit, 'Save'); $rss_display->setComponent('taxonomy_' . $this->vocabulary->id(), [ 'type' => 'entity_reference_rss_category', 'region' => 'content', ]); $rss_display->save(); // Create an article. $node = $this->drupalCreateNode([ 'type' => 'article', $this->fieldName => $term1->id(), ]); // Check that the term is displayed when the RSS feed is viewed. $this->drupalGet('rss.xml'); Loading Loading @@ -139,7 +135,6 @@ public function testTaxonomyRss() { $view->getDisplay()->overrideOption('arguments', $arguments); $view->storage->save(); // Check the article is shown in the feed. $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); $raw_xml = '<title>' . $node->label() . '</title>'; $this->drupalGet('taxonomy/term/all/feed'); $this->assertSession()->responseContains($raw_xml); Loading Loading
core/modules/taxonomy/tests/src/Functional/RssTest.php +15 −20 Original line number Diff line number Diff line Loading @@ -86,27 +86,23 @@ public function testTaxonomyRss() { // Create two taxonomy terms. $term1 = $this->createTerm($this->vocabulary); // RSS display must be added manually. $this->drupalGet("admin/structure/types/manage/article/display"); $edit = [ "display_modes_custom[rss]" => '1', ]; $this->submitForm($edit, 'Save'); // Add the RSS display. $default_display = $this->container->get('entity_display.repository')->getViewDisplay('node', 'article'); $rss_display = $default_display->createCopy('rss'); $rss_display->save(); // Change the format to 'RSS category'. $this->drupalGet("admin/structure/types/manage/article/display/rss"); $edit = [ "fields[taxonomy_" . $this->vocabulary->id() . "][type]" => 'entity_reference_rss_category', "fields[taxonomy_" . $this->vocabulary->id() . "][region]" => 'content', ]; $this->submitForm($edit, 'Save'); // Post an article. $edit = []; $edit['title[0][value]'] = $this->randomMachineName(); $edit[$this->fieldName . '[]'] = $term1->id(); $this->drupalGet('node/add/article'); $this->submitForm($edit, 'Save'); $rss_display->setComponent('taxonomy_' . $this->vocabulary->id(), [ 'type' => 'entity_reference_rss_category', 'region' => 'content', ]); $rss_display->save(); // Create an article. $node = $this->drupalCreateNode([ 'type' => 'article', $this->fieldName => $term1->id(), ]); // Check that the term is displayed when the RSS feed is viewed. $this->drupalGet('rss.xml'); Loading Loading @@ -139,7 +135,6 @@ public function testTaxonomyRss() { $view->getDisplay()->overrideOption('arguments', $arguments); $view->storage->save(); // Check the article is shown in the feed. $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); $raw_xml = '<title>' . $node->label() . '</title>'; $this->drupalGet('taxonomy/term/all/feed'); $this->assertSession()->responseContains($raw_xml); Loading