function ViewsUIQuerySettingsTestCase::testOverrideQuerySettings

Tests that displays can be overridden via the UI.

File

tests/views_ui.test, line 1061

Class

ViewsUIQuerySettingsTestCase
Test the ability of the views query settings.

Code

public function testOverrideQuerySettings() {
  // Create a basic view that shows all content, with a page display.
  $view['human_name'] = $this->randomName(16);
  $view['name'] = strtolower($this->randomName(16));
  $view['page[create]'] = 1;
  $view['page[title]'] = $this->randomName(16);
  $view['page[path]'] = $this->randomName(16);
  $this->drupalPost('admin/structure/views/add', $view, t('Save & exit'));
  // Check override display option in the Query Settings.
  $edit = array();
  $edit['override[dropdown]'] = 'page';
  $this->drupalPost("admin/structure/views/nojs/display/{$view['name']}/page/query", $edit, t('Apply'));
  $this->assertResponse(200);
  // Save the view.
  $this->drupalPost("admin/structure/views/view/{$view['name']}/edit/page", array(), t('Save'));
  $this->assertText($view['page[title]']);
}