function FieldLayoutUninstallTest::testFieldLayoutUninstall

Same name in other branches
  1. 9 core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php \Drupal\Tests\field_layout\Kernel\FieldLayoutUninstallTest::testFieldLayoutUninstall()
  2. 8.9.x core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php \Drupal\Tests\field_layout\Kernel\FieldLayoutUninstallTest::testFieldLayoutUninstall()
  3. 11.x core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php \Drupal\Tests\field_layout\Kernel\FieldLayoutUninstallTest::testFieldLayoutUninstall()

Ensures field layout can be uninstalled with layout builder enabled.

File

core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php, line 17

Class

FieldLayoutUninstallTest
@group field_layout

Namespace

Drupal\Tests\field_layout\Kernel

Code

public function testFieldLayoutUninstall() : void {
    // Setup user schema so user hook uninstall hook doesn't break.
    $this->installSchema('user', 'users_data');
    // Setup layout builder and same displays.
    $this->installLayoutBuilder();
    // Ensure install hook can handle displays without a layout.
    $this->container
        ->get('module_installer')
        ->install([
        'field_layout',
    ]);
    // Ensure uninstall hook can handle displays without a layout.
    $this->container
        ->get('module_installer')
        ->uninstall([
        'field_layout',
    ]);
}

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