function InlineBlockTestBase::assertSaveLayout

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::assertSaveLayout()
  2. 10 core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::assertSaveLayout()
  3. 11.x core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::assertSaveLayout()

Saves a layout and asserts the message is correct.

6 calls to InlineBlockTestBase::assertSaveLayout()
InlineBlockPrivateFilesTest::testPrivateFiles in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
Test access to private files added via inline blocks in the layout builder.
InlineBlockTest::testAccess in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests access to the block edit form of inline blocks.
InlineBlockTest::testDeletion in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests that entity blocks deleted correctly.
InlineBlockTest::testInlineBlocks in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests adding and editing of inline blocks.
InlineBlockTest::testInlineBlocksRevisioning in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests entity blocks revisioning.

... See full list

File

core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php, line 79

Class

InlineBlockTestBase
Base class for testing inline blocks.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function assertSaveLayout() {
    $assert_session = $this->assertSession();
    $page = $this->getSession()
        ->getPage();
    // Reload the page to prevent random failures.
    $this->drupalGet($this->getUrl());
    $page->pressButton('Save layout');
    $this->assertNotEmpty($assert_session->waitForElement('css', '.messages--status'));
    if (stristr($this->getUrl(), 'admin/structure') === FALSE) {
        $assert_session->pageTextContains('The layout override has been saved.');
    }
    else {
        $assert_session->pageTextContains('The layout has been saved.');
    }
}

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