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.

CommentFileSizeAuthor
#5 3185653-5.patch1.86 KBlongwave
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anmolgoyal74 created an issue. See original summary.

anmolgoyal74’s picture

Issue summary: View changes
Kristen Pol’s picture

Issue summary: View changes
Issue tags: +Bug Smash Initiative

Thanks for reporting the issue. The text was not removed in #3177120: Remove references to WebTestBase so updating the issue summary.

longwave’s picture

I 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 test

It is still used, just embedded directly now.

longwave’s picture

Status: Active » Needs review
FileSize
1.86 KB

Locally the relevant tests seem to pass if we remove the code for these comments as well, let's see what happens on testbot.

jibran’s picture

Priority: Minor » Normal
Issue tags: +Quickfix

I had a look at both tests this is indeed deadcode. Nice catch!

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Forgot to change the status.

  • catch committed 422919e on 9.2.x
    Issue #3185653 by longwave, anmolgoyal74, jibran, Kristen Pol: Remove...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 422919e and pushed to 9.2.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.