public function QueryTest::testQueryUI

Tests query plugins settings.

File

drupal/core/modules/views/lib/Drupal/views/Tests/UI/QueryTest.php, line 46
Definition of Drupal\views\Tests\UI\QueryTest.

Class

QueryTest
Tests query plugins.

Namespace

Drupal\views\Tests\UI

Code

public function testQueryUI() {

  // Save some query settings.
  $query_settings_path = "admin/structure/views/nojs/display/test_view/default/query";
  $random_value = $this
    ->randomName();
  $this
    ->drupalPost($query_settings_path, array(
    'query[options][test_setting]' => $random_value,
  ), t('Apply'));
  $this
    ->drupalPost(NULL, array(), t('Save'));

  // Check that the settings are saved into the view itself.
  $view = views_get_view('test_view');
  $view
    ->initDisplay();
  $view
    ->initQuery();
  $this
    ->assertEqual($random_value, $view->query->options['test_setting'], 'Query settings got saved');
}