function QuickEditJavascriptTestBase::assertEntityInstanceFieldMarkup

Same name in other branches
  1. 8.9.x core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditJavascriptTestBase::assertEntityInstanceFieldMarkup()

Asserts all in-place editable fields with markup expectations.

@todo https://www.drupal.org/project/drupal/issues/3178758 Remove deprecation layer and add array typehint.

Parameters

array $expected_field_attributes: Must describe the expected markup attributes for all given in-place editable fields.

7 calls to QuickEditJavascriptTestBase::assertEntityInstanceFieldMarkup()
CKEditor5IntegrationTest::testArticleNode in core/modules/quickedit/tests/src/FunctionalJavascript/CKEditor5IntegrationTest.php
Tests if an article node can be in-place edited with Quick Edit.
CKEditor5IntegrationTest::testDiscard in core/modules/quickedit/tests/src/FunctionalJavascript/CKEditor5IntegrationTest.php
Tests that changes can be discarded.
LayoutBuilderIntegrationTest::testArticleNode in core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderIntegrationTest.php
Tests if an article node can be in-place edited with Quick Edit.
LayoutBuilderIntegrationTest::testCustomBlock in core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderIntegrationTest.php
Tests if a custom can be in-place edited with Quick Edit.
LayoutBuilderQuickEditTest::assertEntityInstanceFieldMarkup in core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
Asserts all in-place editable fields with markup expectations.

... See full list

1 method overrides QuickEditJavascriptTestBase::assertEntityInstanceFieldMarkup()
LayoutBuilderQuickEditTest::assertEntityInstanceFieldMarkup in core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
Asserts all in-place editable fields with markup expectations.

File

core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php, line 257

Class

QuickEditJavascriptTestBase
Base class for testing the QuickEdit.

Namespace

Drupal\Tests\quickedit\FunctionalJavascript

Code

protected function assertEntityInstanceFieldMarkup($expected_field_attributes) {
    if (func_num_args() === 4) {
        $expected_field_attributes = func_get_arg(3);
        @trigger_error('Calling ' . __METHOD__ . '() with 4 arguments is deprecated in drupal:9.1.0 and will throw an error in drupal:10.0.0. See https://www.drupal.org/project/drupal/issues/3037436', E_USER_DEPRECATED);
    }
    if (!is_array($expected_field_attributes)) {
        throw new \InvalidArgumentException('The $expected_field_attributes argument must be an array.');
    }
    foreach ($expected_field_attributes as $quickedit_field_id => $expectation) {
        $element = $this->assertSession()
            ->waitForElementVisible('css', '[data-quickedit-field-id="' . $quickedit_field_id . '"]' . $expectation);
        $this->assertNotEmpty($element, 'Field ' . $quickedit_field_id . ' did not match its expectation selector (' . $expectation . ')');
    }
}

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