Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
SimpleTest's TestBase class has helper methods to import config and copy config objects. We need the same functionalitity on our PHPUnit Kernel tests and Browser tests.
Proposed resolution
Create a trait to share the code
Remaining tasks
Patch.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#18 | config-trait-2759853-18.patch | 8.45 KB | klausi |
Comments
Comment #2
klausiPatch.
Comment #3
martin107 CreditAttribution: martin107 commentedthanks a good idea +1 from me
Patch looks clean
Comment #4
jibranLet's get this in.
Comment #5
dawehnerDoes this has to be public?
Comment #6
klausiProbably not, but it was public on Simpletest's TestBase and KernelTestBase, so I would keep it public to avoid an API break for now.
Comment #7
dawehnerWell, IMHO we can change it to be public later always, but changing from public to protected is more tricky.
Comment #8
klausiYes, and changing it to protected now is tricky because it was public before ;)
Or do you suggest to change the visibility of the method on the old TestBase with
?
Comment #9
dawehnerWell for the old testbase we can set them to be public, but for BTB we could leave them as protected.
Comment #10
klausiYes, makes sense!
Comment #11
dawehnerCool, thank you!
Comment #12
klausiDone!
Comment #13
dawehnerNice! I wasn't even aware that this kind of syntax exists.
Comment #16
klausiLooks like the random test fail from #2749955: Random fails in UpdatePathTestBase tests, retesting.
Comment #17
klausiargl, does not apply anymore.
Comment #18
klausiSimple reroll, no other changes.
Comment #19
dawehnerLet's move back to RTBC
Comment #20
xjmI love this patch!
Committed a1d45d3 and pushed to 8.2.x. Thanks!