Commit 86fc3639 authored by webchick's avatar webchick

Issue #1888694 by dawehner, damiankloip: Simplify DisplayPluginBase::submitOptionsForm().

parent 1043f3df
......@@ -107,7 +107,6 @@ public function testStorePagerSettings() {
$this->assertText('10 items', 'The default value has been changed.');
$this->drupalGet('admin/structure/views/view/test_store_pager_settings/edit/page_1');
$this->assertText('20 items', 'The original value remains unchanged.');
}
/**
......
......@@ -40,10 +40,10 @@ public function testRowUI() {
$row_options_url = "admin/structure/views/nojs/display/$view_name/default/row_options";
$this->drupalGet($row_plugin_url);
$this->assertFieldByName('row', 'fields', 'The default row plugin selected in the UI should be fields.');
$this->assertFieldByName('row[type]', 'fields', 'The default row plugin selected in the UI should be fields.');
$edit = array(
'row' => 'test_row'
'row[type]' => 'test_row'
);
$this->drupalPostForm(NULL, $edit, t('Apply'));
$this->assertFieldByName('row_options[test_option]', NULL, 'Make sure the custom settings form from the test plugin appears.');
......@@ -65,10 +65,10 @@ public function testRowUI() {
$this->assertEqual($row['options']['test_option'], $random_name, 'Make sure that the custom settings field got saved as expected.');
// Change the row plugin to fields using ajax.
$this->drupalPostAjaxForm($row_plugin_url, array('row' => 'fields'), array('op' => 'Apply'), str_replace('/nojs/', '/ajax/', $row_plugin_url));
$this->drupalPostAjaxForm($row_plugin_url, array('row[type]' => 'fields'), array('op' => 'Apply'), str_replace('/nojs/', '/ajax/', $row_plugin_url));
$this->drupalPostAjaxForm(NULL, array(), array('op' => 'Apply'));
$this->assertResponse(200);
$this->assertFieldByName('row', 'fields', 'Make sure that the fields got saved as used row plugin.');
$this->assertFieldByName('row[type]', 'fields', 'Make sure that the fields got saved as used row plugin.');
}
}
......@@ -40,10 +40,10 @@ public function testStyleUI() {
$style_options_url = "admin/structure/views/nojs/display/$view_name/default/style_options";
$this->drupalGet($style_plugin_url);
$this->assertFieldByName('style', 'default', 'The default style plugin selected in the UI should be unformatted list.');
$this->assertFieldByName('style[type]', 'default', 'The default style plugin selected in the UI should be unformatted list.');
$edit = array(
'style' => 'test_style'
'style[type]' => 'test_style'
);
$this->drupalPostForm(NULL, $edit, t('Apply'));
$this->assertFieldByName('style_options[test_option]', NULL, 'Make sure the custom settings form from the test plugin appears.');
......@@ -67,7 +67,7 @@ public function testStyleUI() {
// Test that fields are working correctly in the UI for style plugins when
// a field row plguin is selected.
$this->drupalPostForm("admin/structure/views/view/$view_name/edit", array(), 'Add Page');
$this->drupalPostForm("admin/structure/views/nojs/display/$view_name/page_1/row", array('row' => 'fields'), t('Apply'));
$this->drupalPostForm("admin/structure/views/nojs/display/$view_name/page_1/row", array('row[type]' => 'fields'), t('Apply'));
// If fields are being used this text will not be shown.
$this->assertNoText(t('The selected style or row format does not utilize fields.'));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment