You are here

public function ViewsSettingsRenameTest::testRenameViewsSettings in Drupal 9

Tests upgrading views settings.

@covers \views_post_update_rename_default_display_setting

File

core/modules/views/tests/src/Functional/Update/ViewsSettingsRenameTest.php, line 33

Class

ViewsSettingsRenameTest
Tests renaming views module's configuration.

Namespace

Drupal\Tests\views\Functional\Update

Code

public function testRenameViewsSettings() {
  $config = $this
    ->config('views.settings')
    ->get('ui.show');
  $this
    ->assertArrayHasKey('master_display', $config);
  $this
    ->assertArrayNotHasKey('default_display', $config);
  $this
    ->assertFalse($config['master_display']);

  // Run updates.
  $this
    ->runUpdates();
  $config = $this
    ->config('views.settings')
    ->get('ui.show');
  $this
    ->assertArrayHasKey('default_display', $config);
  $this
    ->assertArrayNotHasKey('master_display', $config);
  $this
    ->assertFalse($config['default_display']);
}