core/modules/system/src/Tests/Ajax/CommandsTest.php | 6 +----- .../modules/ajax_forms_test/ajax_forms_test.module | 20 -------------------- .../src/Form/AjaxFormsTestCommandsForm.php | 12 ------------ 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/core/modules/system/src/Tests/Ajax/CommandsTest.php b/core/modules/system/src/Tests/Ajax/CommandsTest.php index 945a763..ec981a7 100644 --- a/core/modules/system/src/Tests/Ajax/CommandsTest.php +++ b/core/modules/system/src/Tests/Ajax/CommandsTest.php @@ -118,10 +118,6 @@ function testAjaxCommands() { $commands = $this->drupalPostAjaxForm($form_path, $edit, array('op' => t("AJAX 'settings' command"))); $expected = new SettingsCommand(array('ajax_forms_test' => array('foo' => 42))); $this->assertCommand($commands, $expected->render(), "'settings' AJAX command issued with correct data."); - - // Test that the settings command merges settings properly. - $commands = $this->drupalPostAjaxForm($form_path, $edit, array('op' => t("AJAX 'settings' command with setting merging"))); - $expected = new SettingsCommand(array('ajax_forms_test' => array('foo' => 9001)), TRUE); - $this->assertCommand($commands, $expected->render(), "'settings' AJAX command with setting merging."); } + } diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module index 23e06e4..2665c30 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module +++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module @@ -163,26 +163,6 @@ function ajax_forms_test_advanced_commands_add_css_callback($form, FormStateInte } /** - * Ajax callback for 'settings' but with setting overrides. - */ -function ajax_forms_test_advanced_commands_settings_with_merging_callback($form, FormStateInterface $form_state) { - $attached = array( - '#attached' => array( - 'drupalSettings' => array( - 0 => array('ajax_forms_test' => array('foo' => 42)), - '1' => array('ajax_forms_test' => array('foo' => 9001)), - ), - ), - ); - // @todo Why is this being tested via an explicit drupal_render() call? - drupal_render($attached); - drupal_process_attached($attached); - - $response = new AjaxResponse(); - return $response; -} - -/** * Ajax form callback: Selects the 'drivertext' element of the validation form. */ function ajax_forms_test_validation_form_callback($form, FormStateInterface $form_state) { diff --git a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php index 46525e7..f0a3811 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php @@ -194,18 +194,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { ), ); - // Tests the 'settings' command with a callback which sets the same - // setting multiple times. This is used to check that settings are - // merged properly (e.g., array_merge_recursive() merges settings - // incorrectly, #1356170). - $form['settings_command_with_merging_example'] = array( - '#type' => 'submit', - '#value' => $this->t("AJAX 'settings' command with setting merging"), - '#ajax' => array( - 'callback' => 'ajax_forms_test_advanced_commands_settings_with_merging_callback', - ), - ); - $form['submit'] = array( '#type' => 'submit', '#value' => $this->t('Submit'),