Tests feed display admin ui.
public function testFeedUI() {
$this
->drupalGet('admin/structure/views');
// Check the attach TO interface.
$this
->drupalGet('admin/structure/views/nojs/display/test_feed_display/feed/displays');
// Load all the options of the checkbox.
$result = $this
->xpath('//div[@id="edit-displays"]/div');
$options = array();
foreach ($result as $value) {
foreach ($value->input
->attributes() as $attribute => $value) {
if ($attribute == 'value') {
$options[] = (string) $value;
}
}
}
$this
->assertEqual($options, array(
'default',
'page',
), 'Make sure all displays appears as expected.');
// Post and save this and check the output.
$this
->drupalPost('admin/structure/views/nojs/display/test_feed_display/feed/displays', array(
'displays[page]' => 'page',
), t('Apply'));
$this
->drupalGet('admin/structure/views/view/test_feed_display/edit/feed');
$this
->assertFieldByXpath('//*[@id="views-feed-displays"]', 'Page');
// Add the default display, so there should now be multiple displays.
$this
->drupalPost('admin/structure/views/nojs/display/test_feed_display/feed/displays', array(
'displays[default]' => 'default',
), t('Apply'));
$this
->drupalGet('admin/structure/views/view/test_feed_display/edit/feed');
$this
->assertFieldByXpath('//*[@id="views-feed-displays"]', 'Multiple displays');
}