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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

martin107 created an issue. See original summary.

martin107’s picture

Assigned: martin107 » Unassigned
FileSize
7.15 KB
martin107’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 2945578-2.patch, failed testing. View results

Berdir’s picture

This 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.

martin107’s picture

Status: Needs work » Closed (won't fix)

Given the potential for sync issues..