drupalPostAjaxForm() does not exist anymore

Created on 10 November 2024, about 2 months ago

Turning on phpstan evaluation of the test cases (see πŸ“Œ Add declare(strict_types=1) to all test modules Active ) reveals that we still have code in the tests that uses drupalPostAjaxForm(). This method was part of Simpletest and was removed from Drupal core more than 5 years ago by #2809161: Convert Javascript/AJAX testing to use JavascriptTestBase β†’

This method is called from LinkTypeFieldEntryTest::doFlagUiFieldPlugin() which appears to be a utility function for internal use in Flag tests (but it's not declared protected for some reason). However, this utility function is never called so in practice the non-existent drupalPostAjaxForm() never gets called either. That's why this problem only shows up with static analysis, and not in the PHPUnit test output.

This problem was pointed out years ago in #2751053: Convert Simpletests to PHPUnit β†’ but it seems to have been overlooked in the eventual commits.

The simplest thing would be to just delete doFlagUiFieldPlugin() entirely. My preference would be to first determine what that function was intended to test, and before deleting this ensure that Flag does have a WebDriver test that was ported from this Simpletest method at some point.

πŸ› Bug report
Status

Active

Version

4.0

Component

Flag core

Created by

πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @tr
Production build 0.71.5 2024