diff -u b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
--- b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
@@ -116,7 +116,7 @@
     $this->assertEqual(1, $index_count, 'Term 1 is indexed once.');
 
     // Check that the node status is stored correctly.
-    $node_status = (int) db_query('SELECT status FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $node_status = (int) $connection->query('SELECT status FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ])->fetchField();
@@ -124,7 +124,7 @@
 
     // Un publish the article, this should update the register.
     $node->setUnpublished()->save();
-    $node_status = (int) db_query('SELECT status FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $node_status = (int) $connection->query('SELECT status FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ])->fetchField();
