function InlineBlockTestBase::configureInlineBlock

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

Configures an inline block in the Layout Builder.

Parameters

string $old_body: The old body field value.

string $new_body: The new body field value.

string $block_css_locator: The CSS locator to use to select the contextual link.

6 calls to InlineBlockTestBase::configureInlineBlock()
InlineBlockTest::testInlineBlockParentRevert in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Test editing inline blocks when the parent has been reverted.
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.
InlineBlockTest::testInlineBlocksRevisioningIntegrity in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests entity blocks revisioning.
InlineBlockTest::testNoLayoutSave in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests adding a new entity block and then not saving the layout.

... See full list

File

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

Class

InlineBlockTestBase
Base class for testing inline blocks.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function configureInlineBlock($old_body, $new_body, $block_css_locator = NULL) {
    $block_css_locator = $block_css_locator ?: static::INLINE_BLOCK_LOCATOR;
    $assert_session = $this->assertSession();
    $page = $this->getSession()
        ->getPage();
    $this->clickContextualLink($block_css_locator, 'Configure');
    $textarea = $assert_session->waitForElementVisible('css', '[name="settings[block_form][body][0][value]"]');
    $this->assertNotEmpty($textarea);
    $this->assertSame($old_body, $textarea->getValue());
    $textarea->setValue($new_body);
    $page->pressButton('Update');
    $assert_session->assertNoElementAfterWait('css', '#drupal-off-canvas');
    $assert_session->assertWaitOnAjaxRequest();
    $this->assertDialogClosedAndTextVisible($new_body);
}

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