Closed (fixed)
Project:
Layout Builder Restrictions
Version:
3.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2026 at 02:33 UTC
Updated:
13 Mar 2026 at 20:50 UTC
Jump to comment: Most recent
Comments
Comment #3
benjifisherI started with a single commit: update
composer.jsonandREADME.md, adding myself as a maintainer. That is enough to generate a MR and trigger the CI pipeline. I see the same failures as on #3573881.Comment #4
benjifisherI fixed the failing tests and some of the deprecations by replacing
BlockContentType::create()withDrupal\Tests\block_content\Traits\BlockContentCreationTrait::createBlockContentType(). That method has an optional parameter to add a Body field, the equivalent of the deprecatedblock_content_add_body_field().Instead of that, I could have replaced
block_content_add_body_field()withDrupal\Tests\field\Traits\BodyFieldCreationTrait::createBodyField(), which is whatBlockContentCreationTrait::createBlockContentType()calls. That would be one fewer levels of indirection and a few more lines of code.Either way, in order to use non-
static,protectedmethods of a trait, I had to remove thestaticdeclaration fromLayoutBuilderRestrictionsTestBase::generateTestBlocks(). I am not sure why that method was declaredstatic, but it does not seem to matter since it is never called statically. (That is, it is always called as$this->generateTestBlocks(), not asself::generateTestBlocks()norstatic::generateTestBlocks().)Running the test locally, I saw additional deprecation notices. I added the
#[RunTestsInSeparateProcesses]attribute to each concrete test class. See the change record https://www.drupal.org/node/3548485.I also saw this deprecation notice:
I fixed this by updating the configuration of my local Docker containers, following the instructions in the change record. The change record also mentions several test methods that need to be changed. I searched for these methods and did not find any uses.
The tests use the
@groupannotation, but that does not (yet) generate a deprecation notice. Should I replace that with the#[Group()]annotation as part of this issue?Comment #5
benjifisherComment #6
mark_fullmerMakes sense!
Yeah, the static declaration was most likely force of habit; I also don't see a reason it needs to be static.
Thanks for bringing this to my awareness. Looks like I'll be needing to do this in a number of other projects....
Our team also has this in our local tooling for test execution. Thanks for pointing this out.
I'm comfortable with retiring the use of the annotations here in favor of attributes. I don't think we need to keep testing for compatibility with Drupal < 10 at this point.
Comment #7
benjifisherI am setting the status to NW for that, and assigning the issue to myself. It might be a few days before I have time for it, and I do not mind if someone else re-assigns it.
Comment #8
benjifisherI replaced the
@groupannotations in tests with#[Group()]attributes. Back to NR.Comment #9
benjifisherComment #10
benjifisherOops.
Comment #11
mark_fullmerEverything looks great! Thanks for this work, and for future-facing changes related to PHPUnit 12. Marking this as RTBC. Since you're a maintainer, feel free to merge the MR. Then we can turn our attention to #3573881: Fix coding standards violations :)
Comment #13
benjifisher@mark_fullmer:
Done. Thanks for working with me on these issues.