function DatabaseAlterTestCase::testAlterRemoveRange

Test that we can remove a range() value from a query. This also tests hook_query_TAG_alter().

File

modules/simpletest/tests/database_test.test, line 3036

Class

DatabaseAlterTestCase
Select alter tests.

Code

function testAlterRemoveRange() {
    $query = db_select('test');
    $query->addField('test', 'name');
    $query->addField('test', 'age', 'age');
    $query->range(0, 2);
    $query->addTag('database_test_alter_remove_range');
    $num_records = count($query->execute()
        ->fetchAll());
    $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.