diff --git a/core/modules/aggregator/tests/src/Functional/ImportOpmlTest.php b/core/modules/aggregator/tests/src/Functional/ImportOpmlTest.php index 7c6ba1c878..e9037175ed 100644 --- a/core/modules/aggregator/tests/src/Functional/ImportOpmlTest.php +++ b/core/modules/aggregator/tests/src/Functional/ImportOpmlTest.php @@ -2,6 +2,8 @@ namespace Drupal\Tests\aggregator\Functional; +use Drupal\Core\Database\Database; + /** * Tests OPML import. * @@ -70,7 +72,7 @@ public function validateImportFormFields() { * Submits form with invalid, empty, and valid OPML files. */ protected function submitImportForm() { - $connection = \Drupal::database(); + $connection = Database::getConnection(); $before = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField(); $form['files[upload]'] = $this->getInvalidOpml(); diff --git a/core/modules/dblog/tests/src/Functional/DbLogTest.php b/core/modules/dblog/tests/src/Functional/DbLogTest.php index 53ebd8f374..075adb255a 100644 --- a/core/modules/dblog/tests/src/Functional/DbLogTest.php +++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php @@ -4,6 +4,7 @@ use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Unicode; +use Drupal\Core\Database\Database; use Drupal\Core\Logger\RfcLogLevel; use Drupal\Core\Url; use Drupal\dblog\Controller\DbLogController; @@ -554,7 +555,7 @@ public function testFilter() { $this->drupalLogin($this->adminUser); // Clear the log to ensure that only generated entries will be found. - \Drupal::database()->delete('watchdog')->execute(); + Database::getConnection()->delete('watchdog')->execute(); // Generate 9 random watchdog entries. $type_names = []; diff --git a/core/modules/tracker/tests/src/Functional/TrackerTest.php b/core/modules/tracker/tests/src/Functional/TrackerTest.php index 37c3602318..4302ce3d2c 100644 --- a/core/modules/tracker/tests/src/Functional/TrackerTest.php +++ b/core/modules/tracker/tests/src/Functional/TrackerTest.php @@ -5,6 +5,7 @@ use Drupal\comment\CommentInterface; use Drupal\comment\Tests\CommentTestTrait; use Drupal\Core\Cache\Cache; +use Drupal\Core\Database\Database; use Drupal\Core\EventSubscriber\MainContentViewSubscriber; use Drupal\Core\Session\AccountInterface; use Drupal\field\Entity\FieldStorageConfig; @@ -373,7 +374,7 @@ public function testTrackerCronIndexing() { \Drupal::state()->set('tracker.index_nid', 4); // Clear the current tracker tables and rebuild them. - $connection = \Drupal::database(); + $connection = Database::getConnection(); $connection->delete('tracker_node') ->execute(); $connection->delete('tracker_user')