3 namespace Drupal\Tests\datetime_range\Kernel\Views;
5 use Drupal\Core\Config\InstallStorage;
6 use Drupal\Core\Serialization\Yaml;
7 use Drupal\KernelTests\KernelTestBase;
8 use Drupal\views\Entity\View;
11 * Tests datetime_range.module when an entity type provides no views data.
15 class EntityTypeWithoutViewsDataTest extends KernelTestBase {
20 protected static $modules = [
22 'datetime_range_test',
32 * Tests the case when an entity type provides no views data.
34 * @see datetime_test_entity_type_alter()
35 * @see datetime_range_view_presave()
37 public function testEntityTypeWithoutViewsData() {
38 $view_yaml = drupal_get_path('module', 'taxonomy') . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY . '/views.view.taxonomy_term.yml';
39 $values = Yaml::decode(file_get_contents($view_yaml));
40 $this->assertEquals(SAVED_NEW, View::create($values)->save());