- Issue created by @mstrelan
- Status changed to Needs review
4 months ago 2:32am 29 July 2024 - Status changed to Needs work
4 months ago 4:26pm 29 July 2024 - 🇮🇹Italy mondrake 🇮🇹
Like the idea; IMHO we should always explicitly add the
#[Autowire()]
attribute to the property.If we do this, then I think we should consider adding the trait to
KernelTestBase
andBrowserTestBase
. - Status changed to Needs review
4 months ago 10:18pm 29 July 2024 - 🇦🇺Australia mstrelan
Thanks for review, responding to both. Have also split up the setUp method in the trait so classes that have their own setUp method can just call autoSetUp without having parent::setUp called twice.
- 🇦🇺Australia mstrelan
Added another MR based on suggestions from @mondrake in #5
- 🇮🇹Italy mondrake 🇮🇹
I tried to use Symfony's
#[Autowire]
attribute to make things more explicit - PoC so did not change everything.Ideally we could mark
autowireProperties()
with#[Before]
and let PHPUnit call it prior to setUp, but the container is not yet defined at that point. - Status changed to Needs work
4 months ago 11:37pm 30 July 2024 - 🇦🇺Australia mstrelan
@mondrake I accidentally force pushed the wrong branch, can you push your branch back?
- Status changed to Needs review
about 2 months ago 8:24pm 4 October 2024 - 🇮🇹Italy mondrake 🇮🇹
mondrake → changed the visibility of the branch 3464357-autosetup to hidden.
- 🇮🇹Italy mondrake 🇮🇹
Drupal\Tests\content_moderation\Kernel\WorkspacesContentModerationStateTest::testNonLangcodeEntityTypeModeration
fails because it inherits fromDrupal\Tests\content_moderation\Kernel\ContentModerationStateTest
, but the inherited properties are not scanned for autowiring - we need to take care of inheritance especially for base test classes. - 🇮🇹Italy mondrake 🇮🇹
#14 is wrong. The inherited properties inherit the attributes too, https://3v4l.org/WYsXd. The problem was in mixing \Drupal::xxx calls with injected services and usage of traits. Maybe to be addressed but not here.
The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.