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: #3466743: [AdminToolbarToolsSettingsForm] Add basic automated Functional test
 

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dydave created an issue. See original summary.

dydave’s picture

  • dydave committed d2f851b5 on 3.x
    Issue #3519967 by dydave: Added initial Functional Tests for the '...
dydave’s picture

Status: Active » Fixed

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!

Status: Fixed » Closed (fixed)

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