Remove duplicate GenericTest in system.module

Created on 4 August 2025, 12 days ago

Problem/Motivation

GenericTest exists twice in system.module

Steps to reproduce

$ find core/modules/system/tests/src -name "GenericTest.php"
core/modules/system/tests/src/Functional/Module/GenericTest.php
core/modules/system/tests/src/Functional/GenericTest.php

Proposed resolution

git rm core/modules/system/tests/src/Functional/Module/GenericTest.php

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

system.module

Created by

πŸ‡¦πŸ‡ΊAustralia mstrelan

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

  • Issue created by @mstrelan
  • tanushree gupta β†’ made their first commit to this issue’s fork.

  • πŸ‡¦πŸ‡ΊAustralia mstrelan

    @tanushree gupta I see a fork has been created but no code has been pushed to it. Please reach out if you are having trouble, or if you're no longer working on it you can leave a comment so another novice contributor may pick it up.

  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    Both files are almost identical, except that /core/modules/system/tests/src/Functional/GenericTest.php contains an extra "Use" statement that might be required in other test files.

    I deleted the core/modules/system/tests/src/Functional/Module/GenericTest.php as suggested above, run some tests and had no issues.

    daniel@drupal:/var/www/html$ ./vendor/bin/phpunit -c ./web/core/phpunit.xml  /var/www/html/web/core/modules/system/tests/src/Functional/Module
    PHPUnit 10.5.45 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.3.23
    Configuration: /var/www/html/web/core/phpunit.xml
    
    ............S..............                                       27 / 27 (100%)
    
    HTML output was generated.
    http://localhost/sites/simpletest/browser_output/Drupal_Tests_system_Functional_Module_ClassLoaderTest-17-91122015.html
    http://localhost/sites/simpletest/browser_output/Drupal_Tests_system_Functional_Module_ClassLoaderTest-18-91122015.html
    http://localhost/sites/simpletest/browser_output/Drupal_Tests_system_Functional_Module_ClassLoaderTest-19-40134029.html
    http://localhost/sites/simpletest/browser_output/Drupal_Tests_system_Functional_Module_ClassLoaderTest-20-40134029.html
    http://localhost/sites/simpletest/browser_output/Drupal_Tests_system_Functional_Module_ClassLoaderTest-21-46941890.html
    http://localhost/sites/simpletest/browser_output/Drupal_Tests_system_Functional_Module_ClassLoaderTest-22-46941890.html
    ...
    ...
    ...
    http://localhost/sites/simpletest/browser_output/Drupal_Tests_system_Functional_Module_VersionTest-14-13678813.html
    http://localhost/sites/simpletest/browser_output/Drupal_Tests_system_Functional_Module_VersionTest-15-13678813.html
    http://localhost/sites/simpletest/browser_output/Drupal_Tests_system_Functional_Module_VersionTest-16-13678813.html
    
    
    Time: 08:12.027, Memory: 8.00 MB
    
    OK, but some tests were skipped!
    
  • @danrod opened merge request.
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡§πŸ‡ͺBelgium BramDriesen Belgium πŸ‡§πŸ‡ͺ

    Looks good to me. Also referencing the issue where those test cases where initially added and why they exist.

    core/modules/system/tests/src/Functional/GenericTest.php is indeed the one to keep.

  • πŸ‡¦πŸ‡ΊAustralia mstrelan

    Between @danrod, @bramdriesen and myself we've got 47 years of experience to get this novice issue in. I tagged it hoping it could help a new contributor. Nevertheless, let's get this in, maybe we can all opt out of receiving credit for this one.

  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    In my defense, I only have 3 Drupal Core credits in total, so I guess I could be considered a "novice" user in this matter, but yes, I'm also fine with opting out of the credits on this one.

    Cheers!

  • πŸ‡§πŸ‡ͺBelgium BramDriesen Belgium πŸ‡§πŸ‡ͺ

    I came here because of a slack discussion. If a review can help land an issue I will do so (a bit in the light of the boy scout rule). I actively try to avoid working on novice issues and even create novice issues for the modules I maintain for others to pick up πŸ™‚. But reviewing a core issue in my perspective might fall outside of a novice task. Especially one like this where one might think you can just delete the two empty test cases.

    • catch β†’ committed b10ea512 on 11.x
      Issue #3539501 by danrod, tanushree gupta, mstrelan, bramdriesen: Remove...
    • catch β†’ committed 683a48f1 on 11.2.x
      Issue #3539501 by danrod, tanushree gupta, mstrelan, bramdriesen: Remove...
  • πŸ‡¬πŸ‡§United Kingdom catch

    Committed/pushed to 11.x, thanks!

    I added credit for everyone here including tanushree gupta because they confirmed they were beaten to it on this issue in slack.

    While this was tagged novice, extra entire test classes that run for no reason are confusing and waste CI time so it's good to resolve this one.

Production build 0.71.5 2024