You are here

function EntityFieldQueryTestCase::testEntityFieldQueryDisablePager in Drupal 7

Tests disabling the pager in EntityFieldQuery.

File

modules/simpletest/tests/entity_query.test, line 1414
Unit test file for the entity API.

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);
}