You are here

public function SiteMapRssTest::testRssFeedForFrontPage in Site map 8

Tests RSS feed for front page.

File

src/Tests/SiteMapRssTest.php, line 34

Class

SiteMapRssTest
Test case class for site map RSS feed tests.

Namespace

Drupal\site_map\Tests

Code

public function testRssFeedForFrontPage() {

  // Assert default RSS feed for front page.
  $this
    ->drupalGet('/sitemap');
  $this
    ->assertLinkByHref('/rss.xml');

  // Change RSS feed for front page.
  $href = Unicode::strtolower($this
    ->randomMachineName());
  $edit = array(
    'rss_front' => $href,
  );
  $this
    ->drupalPostForm('admin/config/search/sitemap', $edit, t('Save configuration'));

  // Assert that RSS feed for front page has been changed.
  $this
    ->drupalGet('/sitemap');
  $this
    ->assertLinkByHref('/' . $href);
}