function EntityTypeWithoutViewsDataTest::testEntityTypeWithoutViewsData

Same name and namespace in other branches
  1. 9 core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php \Drupal\Tests\datetime_range\Kernel\Views\EntityTypeWithoutViewsDataTest::testEntityTypeWithoutViewsData()
  2. 8.9.x core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php \Drupal\Tests\datetime_range\Kernel\Views\EntityTypeWithoutViewsDataTest::testEntityTypeWithoutViewsData()
  3. 10 core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php \Drupal\Tests\datetime_range\Kernel\Views\EntityTypeWithoutViewsDataTest::testEntityTypeWithoutViewsData()

Tests the case when an entity type provides no views data.

See also

datetime_test_entity_type_alter()

File

core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php, line 38

Class

EntityTypeWithoutViewsDataTest
Tests <a href="/api/drupal/core%21modules%21datetime_range%21datetime_range.module/11.x" title="Field hooks to implement a datetime field that stores a start and end date." class="local">datetime_range.module</a> when an entity type provides no views data.

Namespace

Drupal\Tests\datetime_range\Kernel\Views

Code

public function testEntityTypeWithoutViewsData() : void {
    $view_yaml = $this->getModulePath('taxonomy') . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY . '/views.view.taxonomy_term.yml';
    $values = Yaml::decode(file_get_contents($view_yaml));
    $this->assertEquals(SAVED_NEW, View::create($values)->save());
}

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