function MediaTest::assertContextMenuItemExists

Asserts that a context menu item exists by aria-label attribute.

@internal

Parameters

string $label: The `aria-label` attribute value of the context menu item.

1 call to MediaTest::assertContextMenuItemExists()
MediaTest::testLinkability in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests linkability of the CKEditor widget.

File

core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php, line 1541

Class

MediaTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21ckeditor%21src%21Plugin%21CKEditorPlugin%21DrupalMedia.php/class/DrupalMedia/9" title="Defines the &quot;drupalmedia&quot; plugin." class="local">\Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalMedia</a> @group ckeditor @group legacy

Namespace

Drupal\Tests\ckeditor\FunctionalJavascript

Code

protected function assertContextMenuItemExists(string $label) : void {
    $this->assertSession()
        ->elementExists('xpath', '//a[@aria-label="' . $label . '"]');
}

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