Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
drupalPostAjaxForm()
was part of WebTestBase.php
which has been deprecated in 8.8 and removed in 9.0. It is still mentioned in two places:
core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestDialogForm.php
public function buildForm(array $form, FormStateInterface $form_state) {
// In order to use WebTestBase::drupalPostAjaxForm() to POST from a link,
// we need to have a dummy field we can set in
// WebTestBase::drupalPostForm() else it won't submit anything.
modules/system/tests/src/Functional/Ajax/FrameworkTest.php
// Load any page with at least one CSS file, at least one JavaScript file
// and at least one #ajax-powered element. The latter is an assumption of
// drupalPostAjaxForm(), the two former are assumptions of the Ajax
// renderer.
// @todo refactor AJAX Framework + tests to make less assumptions.
$this->drupalGet('ajax_forms_test_lazy_load_form');
Steps to reproduce
Proposed resolution
Documentation needs to be updated.
Remaining tasks
Documentation needs to be updated.
Comment | File | Size | Author |
---|---|---|---|
#5 | 3185653-5.patch | 1.86 KB | longwave |
Comments
Comment #2
anmolgoyal74 CreditAttribution: anmolgoyal74 at OpenSense Labs for DrupalFit commentedComment #3
Kristen PolThanks for reporting the issue. The text was not removed in #3177120: Remove references to WebTestBase so updating the issue summary.
Comment #4
longwaveI can't see where AjaxTestDialogForm is actually used. It looks like the only use of it may have been refactored away in #2874640: Convert DialogTest to a FunctionalJavascript testIt is still used, just embedded directly now.
Comment #5
longwaveLocally the relevant tests seem to pass if we remove the code for these comments as well, let's see what happens on testbot.
Comment #6
jibranI had a look at both tests this is indeed deadcode. Nice catch!
Comment #7
jibranForgot to change the status.
Comment #9
catchCommitted 422919e and pushed to 9.2.x. Thanks!