Move defaultTheme definition in file.module Functional tests to base classes where possible

Created on 18 November 2019, about 5 years ago
Updated 16 January 2023, almost 2 years ago

Problem/Motivation

Most of the test classes under core/modules/file/tests/src/Functional are derived from either FileFieldTestBase or FileManagedTestBase. Both of those define their own static $modules array.

However, when we did #3082655: Specify the $defaultTheme property in all functional tests β†’ we didn't notice this fact, and put separate $defaultTheme definitions in all the children.

3 of them apparently depended on classy markup, so those set defaultTheme to classy. Everything else uses stark.

In addition to being duplicate code in most cases, these hunks can cause otherwise backportable test changes / additions to require separate patches for different branches, which is a minor hassle and creates more work for ourselves.

Proposed resolution

  • Put protected $defaultTheme = 'stark'; in the parent test classes.
  • Remove that from (almost) all the child classes.
  • Let the 3 tests that (apparently) need 'classy' to continue to override $defaultTheme themselves.

Remaining tasks

  1. Do it.
  2. Make sure we didn't break anything.
  3. Review.
  4. RTBC.
  5. Commit.

User interface changes

-

API changes

None. Tests aren't API.

Data model changes

-

Release notes snippet

-

πŸ“Œ Task
Status

Needs work

Version

9.5

Component
File systemΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States dww

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

  • Status changed to RTBC almost 2 years ago
  • Status changed to Needs work almost 2 years ago
Production build 0.71.5 2024