diff --git a/core/modules/system/src/Tests/Entity/EntityQueryTest.php b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
index e5d738ff924fbd62254659404ded0b06ca74e476..fd4165bb771e3b7c7d888d83369080bc0b153cef 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
@@ -222,7 +222,7 @@ function testEntityQuery() {
     $query = $this->factory->get('entity_test_mulrev');
     $group_blue = $query->andConditionGroup()->condition("$figures.color", array('blue'), 'IN');
     $group_red = $query->andConditionGroup()->condition("$figures.color", array('red'), 'IN');
-    $query
+    $this->queryResults = $query
       ->condition($group_blue)
       ->condition($group_red)
       ->sort('id')