public function DisplayFeedTest::testFeedOutput

Tests the rendered output.

File

drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php, line 84
Definition of Drupal\views\Tests\Plugin\DisplayFeedTest.

Class

DisplayFeedTest
Tests the feed display plugin.

Namespace

Drupal\views\Tests\Plugin

Code

public function testFeedOutput() {
  $this
    ->drupalCreateNode();

  // Test the site name setting.
  $site_name = $this
    ->randomName();
  $this->container
    ->get('config.factory')
    ->get('system.site')
    ->set('name', $site_name)
    ->save();
  $this
    ->drupalGet('test-feed-display.xml');
  $result = $this
    ->xpath('//title');
  $this
    ->assertEqual($result[0], $site_name, 'The site title is used for the feed title.');
  $views = $this->container
    ->get('plugin.manager.entity')
    ->getStorageController('view')
    ->load(array(
    'test_feed_display',
  ));
  $view = array_pop($views);
  $display =& $view
    ->getDisplay('feed_1');
  $display['display_options']['sitename_title'] = 0;
  $view
    ->save();
  $this
    ->drupalGet('test-feed-display.xml');
  $result = $this
    ->xpath('//title');
  $this
    ->assertEqual($result[0], 'test_feed_display', 'The display title is used for the feed title.');
}