public function SelectComplexTest::testRangeUndo in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php \Drupal\KernelTests\Core\Database\SelectComplexTest::testRangeUndo()
- 10 core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php \Drupal\KernelTests\Core\Database\SelectComplexTest::testRangeUndo()
Test whether the range property of a select clause can be undone.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ SelectComplexTest.php, line 162
Class
- SelectComplexTest
- Tests the Select query builder with more complex queries.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testRangeUndo() {
$query = $this->connection
->select('test');
$query
->addField('test', 'name');
$query
->addField('test', 'age', 'age');
$query
->range(0, 2);
$query
->range(NULL, NULL);
$query_result = $query
->countQuery()
->execute()
->fetchField();
$this
->assertEqual($query_result, 4, 'Returned the correct number of rows.');
}