function EntityFieldQueryTestCase::testTablePrefixing

Tests EFQ table prefixing with multiple conditions and an altered join.

See also

field_test_query_efq_table_prefixing_test_alter()

File

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

Class

EntityFieldQueryTestCase
Tests EntityFieldQuery.

Code

function testTablePrefixing() {
  $query = new EntityFieldQuery();
  $query = $query->entityCondition('entity_type', 'test_entity')
    ->entityCondition('bundle', 'test_bundle')
    ->entityCondition('entity_id', '1')
    ->addTag('efq_table_prefixing_test');
  $expected = array(
    array(
      'test_entity',
      1,
    ),
  );
  $this->assertEntityFieldQuery($query, $expected, 'An EntityFieldQuery returns the expected results when altered with an additional join on the base table.');
}

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