diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php index 7c5a737..3fe713b 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php @@ -163,14 +163,9 @@ function testRangeUndo() { $age_field = $query->addField('test', 'age', 'age'); $query->range(0, 2); $query->range(NULL, NULL); - $result = $query->execute(); - - $num_records = 0; - foreach ($result as $record) { - $num_records++; - } + $query_result = $query->countQuery()->execute()->fetchField(); - $this->assertEqual($num_records, 4, 'Returned the correct number of rows.'); + $this->assertEqual($query_records, 4, 'Returned the correct number of rows.'); } /**