You are here

function EFQViewsFieldTestCase::testFields in EntityFieldQuery Views Backend 7

File

tests/efq_views.test, line 130
Tests for EFQ Views query features.

Class

EFQViewsFieldTestCase

Code

function testFields() {
  $this
    ->runView();
  $entity = $this->entities[0];
  $this
    ->assertPattern("/Entity ID: +{$entity->eid}/", 'Entity ID found');
  $this
    ->assertPattern("/Efq views test ID: +{$entity->eid}/", 'Entity ID (meta) found');
  $this
    ->assertPattern("/Test_boolean: +Yes/", 'Boolean found');
  $this
    ->assertPattern('/Test_decimal: +' . $entity->test_decimal / 100 . '/', 'Decimal found');
  $this
    ->assertPattern('/Test_date: +' . preg_quote(format_date($entity->test_date), '/') . '/', 'Date found');
  $this
    ->assertPattern('/Test_text: +test text/', 'Test text found');
  $url = url("custom/{$entity->uid}", array(
    'absolute' => TRUE,
  ));
  $this
    ->assertPattern('/URL: +' . preg_quote(l($url, $url), '/') . '/', 'URL found');
  $this
    ->assertPattern('/field boolean: +On/', 'Boolean field API field found');
  $this
    ->assertPattern('/Bundle: +' . $entity->ebundle . '/', 'Bundle field found');
  $this
    ->assertPattern('/Bundle label: +' . preg_quote(t('Bundle 1'), '/') . '/', 'Bundle label field found');
  $this
    ->assertPattern('/Label: +' . preg_quote($entity->elabel, '/') . '/', 'Label field found');
}