function MediaUiReferenceWidgetTest::assertNoHelpLink

Same name in other branches
  1. 10 core/modules/media/tests/src/Functional/MediaUiReferenceWidgetTest.php \Drupal\Tests\media\Functional\MediaUiReferenceWidgetTest::assertNoHelpLink()

Asserts that a given link is not present.

@internal

Parameters

\Behat\Mink\Element\NodeElement $element: The element to search.

string $text: The link text.

1 call to MediaUiReferenceWidgetTest::assertNoHelpLink()
MediaUiReferenceWidgetTest::testMediaReferenceWidget in core/modules/media/tests/src/Functional/MediaUiReferenceWidgetTest.php
Tests the default autocomplete widgets for media reference fields.

File

core/modules/media/tests/src/Functional/MediaUiReferenceWidgetTest.php, line 349

Class

MediaUiReferenceWidgetTest
Ensures that media UI works correctly.

Namespace

Drupal\Tests\media\Functional

Code

protected function assertNoHelpLink(NodeElement $element, string $text) : void {
    $assert_session = $this->assertSession();
    // Assert that the link and its text are not present anywhere on the page.
    $assert_session->elementNotExists('named', [
        'link',
        $text,
    ], $element);
    $assert_session->pageTextNotContains($text);
}

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