Use \Drupal, not $this->container, in functional tests
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3564779. --> Reported by: [phenaproxima](https://www.drupal.org/user/205645) Related to !731 >>> <p>In functional tests, <code>$this-&gt;container</code> is deprecated: <a href="https://www.drupal.org/node/3492500">https://www.drupal.org/node/3492500</a></p> <p>We should switch now to the <code>\Drupal</code> pattern recommended in that change record, to get ahead of the change and spare ourselves the cleanup later.</p> <p>This should be changed in every functional and functional JavaScript test in Drupal CMS's code base. Unit and kernel tests should not be altered.</p> <p>Tagged as a novice issue because it's basically a search-and-replace. In any file like <code>tests/src/Functional/*Test.php</code> or <code>tests/src/FunctionalJavaScript/*Test.php</code>, replace <code>$this-&gt;container-&gt;get()</code> calls with <code>\Drupal::service()</code>.</p>
issue