function LayoutBuilderQuickEditTest::assertQuickEditInit

Same name in other branches
  1. 8.9.x core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderQuickEditTest::assertQuickEditInit()

Asserts that Quick Edit is initialized on the node view correctly.

@todo Replace calls to this method with calls to ::doTestArticle() in https://www.drupal.org/node/3037436.

Parameters

string[] $fields: The fields test.

2 calls to LayoutBuilderQuickEditTest::assertQuickEditInit()
LayoutBuilderQuickEditTest::testEnableDisableLayoutBuilder in core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
Tests Quick Edit boots correctly with Layout Builder defaults & overrides.
LayoutBuilderQuickEditTest::testQuickEditIgnoresDuplicateFields in core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
Tests that Quick Edit still works even when there are duplicate fields.

File

core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php, line 332

Class

LayoutBuilderQuickEditTest
Tests that Layout Builder functions with Quick Edit.

Namespace

Drupal\Tests\quickedit\FunctionalJavascript

Code

private function assertQuickEditInit(array $fields) : void {
    $this->assertNotEmpty($fields);
    $node = $this->article;
    $this->drupalGet('node/' . $node->id());
    // Initial state.
    $this->awaitQuickEditForEntity('node', 1);
    $this->assertEntityInstanceStates([
        'node/1[0]' => 'closed',
    ]);
    $field_states = [];
    foreach ($fields as $field) {
        $field_states["node/1/{$field}/en/full"] = 'inactive';
    }
    $this->assertEntityInstanceFieldStates('node', 1, 0, $field_states);
}

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