function LayoutBuilderQuickEditTest::revertLayoutToDefaults

Same name in other branches
  1. 9 core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php \Drupal\Tests\quickedit\FunctionalJavascript\LayoutBuilderQuickEditTest::revertLayoutToDefaults()

Reverts a layout override.

1 call to LayoutBuilderQuickEditTest::revertLayoutToDefaults()
LayoutBuilderQuickEditTest::testEnableDisableLayoutBuilder in core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
Tests Quick Edit boots correctly with Layout Builder defaults & overrides.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php, line 283

Class

LayoutBuilderQuickEditTest
Tests that Layout Builder functions with Quick Edit.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function revertLayoutToDefaults() {
    $page = $this->getSession()
        ->getPage();
    $assert_session = $this->assertSession();
    // Save the current user to re-login after Layout Builder changes.
    $user = $this->loggedInUser;
    $this->loginLayoutAdmin();
    $this->drupalGet('node/' . $this->article
        ->id() . '/layout');
    $assert_session->buttonExists('Revert to defaults');
    $page->pressButton('Revert to defaults');
    $page->pressButton('Revert');
    $assert_session->pageTextContains('The layout has been reverted back to defaults.');
    $this->drupalLogin($user);
}

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