function EntityViewsDataTest::testBaseTables

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php \Drupal\Tests\views\Kernel\Entity\EntityViewsDataTest::testBaseTables()
  2. 10 core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php \Drupal\Tests\views\Kernel\Entity\EntityViewsDataTest::testBaseTables()
  3. 11.x core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php \Drupal\Tests\views\Kernel\Entity\EntityViewsDataTest::testBaseTables()

Tests base tables.

File

core/modules/views/tests/src/Unit/EntityViewsDataTest.php, line 205

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

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