Create test trait to set update_test module settings

Created on 15 March 2023, almost 2 years ago
Updated 1 August 2023, over 1 year ago

Problem/Motivation

In Package Manager and Automatic Updates, which are both planned for core inclusion, we need to the update_test module to

  1. Set project versions
  2. Set fixture update XML files to use

We are duplicating logic in the Update module for this. The Update module itself is also duplicating a lot of logic.

There around 30 instances of $this->config('update_test.settings')->set were we save either system_info or 'xml_map'. Even though I(tedbow) am an Update module maintainer I often just have to grep the code base to remember where these settings take effect(update_test_system_info_alter and \Drupal\update_test\Controller\UpdateTestController)

Proposed resolution

Create UpdateTestTrait which will have 2 methods to update system_info and 'xml_map'. Replace all calls to save 'update_test.settings' with calls to this trait.

The methods on this trait should have @see to where these settings are used in the update_test module

I think the name setSystemInfo is a bit confusing when it's just setting the info for the installed modules. The #all is hard to understand at first since I am making a wrapper anyway i could have the #all's version as an optional parameter to just add it it in the system_info array.

Remaining tasks

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Update 

Last updated 6 days ago

  • Maintained by
  • 🇺🇸United States @tedbow
  • 🇺🇸United States @dww
Created by

🇺🇸United States tedbow Ithaca, NY, USA

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024