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.
The title of this issue parallels
#2066993: Use \Drupal consistently in tests
Something bugged me about the way I wrote the test in
#2944815: Update FlagBookmarkUITest
I introduced a \Drupal::service() call .. and so this weekend I went back and worked out that I had made a mistake
As a maintenance cleanup I think we should use $this->container->get() as intended where possible.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2945578-2.patch | 7.15 KB | martin107 |
Comments
Comment #2
martin107 CreditAttribution: martin107 as a volunteer commentedComment #3
martin107 CreditAttribution: martin107 as a volunteer commentedComment #5
BerdirThis is the same container, as discussed in the core issue, I dont' see why $this->container is an improvement over \Drupal, both are the same global container, except $this->container can actually get out of sync if you install modules in a test or something like that.
Comment #6
martin107 CreditAttribution: martin107 as a volunteer commentedGiven the potential for sync issues..