Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298686

Reconsider how defaultTheme is defined in file.module Functional tests

$
0
0

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

-


Viewing all articles
Browse latest Browse all 298686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>