Normalize on fixtures/ directory name for tests

Created on 13 February 2018, over 7 years ago
Updated 7 August 2024, 9 months ago

Problem/Motivation

#2661542-10: Isolate Drupal\Tests\Component\Plugin\DefaultFactoryTest from core test module β†’ brings up a good point. We have a lot of different versions of how to specify a fixtures directory.

$ cd core/
$ find . -iname 'fixture*' -type d
./modules/block/tests/fixtures
./modules/content_moderation/tests/fixtures
./modules/dblog/tests/fixtures
./modules/field/tests/fixtures
./modules/file/tests/fixtures
./modules/hal/tests/fixtures
./modules/media/tests/fixtures
./modules/migrate_drupal/tests/fixtures
./modules/rest/tests/fixtures
./modules/simpletest/tests/fixtures
./modules/system/tests/fixtures
./modules/user/tests/fixtures
./modules/views/tests/fixtures
./tests/Drupal/Tests/Component/Annotation/Fixtures
./tests/Drupal/Tests/Component/DependencyInjection/Fixture
./tests/Drupal/Tests/Component/Diff/Engine/fixtures
./tests/Drupal/Tests/Component/FileCache/Fixtures
./tests/Drupal/Tests/Component/Utility/fixtures
./tests/Drupal/Tests/Core/Config/Entity/Fixtures
./tests/Drupal/Tests/Core/DependencyInjection/Fixture
./tests/Drupal/Tests/Core/DrupalKernel/fixtures
./tests/Drupal/Tests/Core/Form/fixtures
./tests/Drupal/Tests/Core/Plugin/Discovery/Fixtures
./tests/Drupal/Tests/Core/Plugin/Fixtures
./tests/fixtures

So we have some plural, some uppercase.

In modules we seem to have normalized on fixtures/ (lower case, plural).

Other places not so much.

Proposed resolution

Follow the lead of module tests and use lower-case plural.

Rename test fixture directories in core this way.

Fix tests that need them.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
OtherΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States mile23 Seattle, WA

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.

  • πŸ‡¬πŸ‡§United Kingdom joachim

    Furthermore, there are fixtures in multiple places for the same group of tests!

    e.g.:

    - core/tests/fixtures/plugins
    - core/tests/Drupal/Tests/Component/Plugin/Fixtures

    and that also probably has fixtures for Core-core, so we have this pair too:

    - core/tests/fixtures/plugins
    - core/tests/Drupal/Tests/Core/Plugin/Fixtures

Production build 0.71.5 2024