Problem/Motivation
Let's convert test theme to oop.
InstallerTranslationTest does something strange during install time that blows up if hooks are OOP.
Steps to reproduce
Convert test_theme
Run core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
Proposed resolution
Convert test theme to OOP hooks and add DI
Allow install kernel container dumping, this was a relic of simple test an no longer needed
Remove test for loading classes in .theme since the nature of OOP theme hooks ensure that theme namespaces are loaded at the correct time
Add parameter types to hook class
Remaining tasks
Review
User interface changes
N/A
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #2
nicxvan commentedComment #4
nicxvan commentedStill haven't figured out why Installer test is failing,
It fails here:
Comment #5
nicxvan commentedOk, @berdir was able to find the root cause, it is due to the installer base setting dumping to false.
After converting to oop the install requires the container to build so this is a test artifact.
Berdir tracked that parameter to #2016629: Refactor bootstrap to better utilize the kernel.
Znerol in comment 221 describes it as necessary for to simpler which we no longer use.
I reached out to chx to ask his opinion and he agrees that the setting is outdated here.
Tests are happy so I think this is ready.
Comment #6
nicxvan commentedI was premature, there is still one real failure.
Comment #8
berdirHow about we just call this one "Convert test_theme to OOP" ? It's not "after" fixing InstallerTranslationTest, we are fixing InstallerTranslationTest here.
Comment #9
nicxvan commentedNo objection, it was a reminder to myself which test was failing.
Comment #10
nicxvan commentedReady for review again
Comment #11
berdirI think this looks great now. added two comments as explanations for reviewers.
Comment #14
longwaveThanks, this is nice cleanup - especially good that
test_theme_theme_test_alter_alterandtest_theme_theme_suggestions_theme_test_suggestions_alterare finally gone as those names have always confused me - at least they're slightly shorter now :DBackported to 11.x to keep things in sync.
Committed and pushed b75cccea7c8 to main and e15e26c9f0b to 11.x. Thanks!