function EntityFieldQueryTestCase::testEntityFieldQueryDisablePager

Tests disabling the pager in EntityFieldQuery.

File

modules/simpletest/tests/entity_query.test, line 1418

Class

EntityFieldQueryTestCase
Tests EntityFieldQuery.

Code

function testEntityFieldQueryDisablePager() {
    // Test enabling a pager and then disabling it.
    $query = new EntityFieldQuery();
    $query->entityCondition('entity_type', 'test_entity_bundle_key')
        ->propertyOrderBy('ftid', 'ASC')
        ->pager(1)
        ->pager(0);
    $this->assertEntityFieldQuery($query, array(
        array(
            'test_entity_bundle_key',
            1,
        ),
        array(
            'test_entity_bundle_key',
            2,
        ),
        array(
            'test_entity_bundle_key',
            3,
        ),
        array(
            'test_entity_bundle_key',
            4,
        ),
        array(
            'test_entity_bundle_key',
            5,
        ),
        array(
            'test_entity_bundle_key',
            6,
        ),
    ), 'All test entities are listed when the pager is enabled and then disabled.', TRUE);
}

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