Problem/Motivation

system.module is included by a phpunit which means that you can have possible unexpected side effects. For example, #2349991: Provide a trait for categorizing plugin managers and use it for conditions and actions adds a unit test that creates the system_get_info() so it can unit test but then you get the following error if you run all the phpunit tests.

PHP Fatal error:  Cannot redeclare system_get_info() (previously declared in /Volumes/devdisk/dev/drupal/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php:150) in /Volumes/devdisk/dev/drupal/core/modules/system/system.module on line 852

Fatal error: Cannot redeclare system_get_info() (previously declared in /Volumes/devdisk/dev/drupal/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php:150) in /Volumes/devdisk/dev/drupal/core/modules/system/system.module on line 852

Proposed resolution

Fix core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest

Remaining tasks

Review

User interface changes

None

API changes

None

CommentFileSizeAuthor
#1 2392281.1.patch1.76 KBalexpott
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott’s picture

Status: Active » Needs review
FileSize
1.76 KB
amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Yup, makes sense :)

dawehner’s picture

... it would be so great to be disable loading of non-classes in PHP somehow.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed c902ba6 on 8.0.x
    Issue #2392281 by alexpott: system.module is included in our PHPUnit...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.