[AdminToolbarSearchSettingsForm] Add basic automated Functional Tests

Created on 18 April 2025, 11 days ago

Problem/Motivation

Currently the admin_toolbar_search module does not have any Tests in place to run the code of its Settings form AdminToolbarSearchSettingsForm.

There is currently no way to test whether the form could be properly submitted or not.

Steps to reproduce

Run PHPUNIT Tests or build pipeline at:
https://git.drupalcode.org/project/admin_toolbar/-/pipelines

Proposed resolution

Add a basic Functional Test class, which displays the form, submits it with default values and checks whether the submission was successful.

We could just copy the current Test class for the AdminToolbarToolsSettingsForm in the admin_toolbar_tools module, see:
https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/admin_toolba...

See similar ticket: 🐛 [AdminToolbarToolsSettingsForm] Fix Fatal Error: Call to undefined method Drupal\Core\Menu\MenuLinkManager::invalidateAll() Active
 

📌 Task
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France dydave

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

Merge Requests

Comments & Activities

  • Issue created by @dydave
  • Pipeline finished with Success
    11 days ago
    Total: 394s
    #476887
    • dydave committed d2f851b5 on 3.x
      Issue #3519967 by dydave: Added initial Functional Tests for the '...
  • 🇫🇷France dydave

    Quick follow-up on this issue:

    Copied over the same Tests class from the admin_toolbar_tools module and made a few adjustments to match with the admin_toolbar_search module.

    This is a very basic initial Tests class, with the bare minimum:

    • Browse to admin/config/user-interface/admin-toolbar-search-settings
    • Submit the form
    • Check the settings were saved with a success message.

     

    Since all the jobs and tests were still passing 🟢, I went ahead and merged the changes above at #4.

    This class should allow us to detect any issues with the schema or any other form related code and be used as the basis for adding more checks and automated tests for the admin_toolbar_search module.

    Marking issue as Fixed for now.

    Thanks in advance!

Production build 0.71.5 2024