You are here

public function EntityViewsDataTest::testBaseTables in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Unit/EntityViewsDataTest.php \Drupal\Tests\views\Unit\EntityViewsDataTest::testBaseTables()

Tests base tables.

File

core/modules/views/tests/src/Unit/EntityViewsDataTest.php, line 172
Contains \Drupal\Tests\views\Unit\EntityViewsDataTest.

Class

EntityViewsDataTest
@coversDefaultClass \Drupal\views\EntityViewsData @group Views

Namespace

Drupal\Tests\views\Unit

Code

public function testBaseTables() {
  $data = $this->viewsData
    ->getViewsData();
  $this
    ->assertEquals('entity_test', $data['entity_test']['table']['entity type']);
  $this
    ->assertEquals(FALSE, $data['entity_test']['table']['entity revision']);
  $this
    ->assertEquals('Entity test', $data['entity_test']['table']['group']);
  $this
    ->assertEquals('entity_test', $data['entity_test']['table']['provider']);
  $this
    ->assertEquals('id', $data['entity_test']['table']['base']['field']);
  $this
    ->assertEquals([
    'entity_test_list_cache_context',
  ], $data['entity_test']['table']['base']['cache_contexts']);
  $this
    ->assertEquals('Entity test', $data['entity_test']['table']['base']['title']);
  $this
    ->assertFalse(isset($data['entity_test']['table']['defaults']));
  $this
    ->assertFalse(isset($data['entity_test_mul_property_data']));
  $this
    ->assertFalse(isset($data['revision_table']));
  $this
    ->assertFalse(isset($data['revision_data_table']));
}