function MediaLibraryTestBase::assertAnnounceContains

Same name in other branches
  1. 11.x core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::assertAnnounceContains()

Checks for inclusion of text in #drupal-live-announce.

@internal

Parameters

string $expected_message: The text expected to be present in #drupal-live-announce.

2 calls to MediaLibraryTestBase::assertAnnounceContains()
MediaLibraryTestBase::switchToMediaLibraryGrid in core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php
Switches to the grid display of the widget view.
MediaLibraryTestBase::switchToMediaLibraryTable in core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php
Switches to the table display of the widget view.
1 method overrides MediaLibraryTestBase::assertAnnounceContains()
EntityReferenceWidgetTest::assertAnnounceContains in core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php
Checks for inclusion of text in #drupal-live-announce.

File

core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php, line 486

Class

MediaLibraryTestBase
Base class for functional tests of Media Library functionality.

Namespace

Drupal\Tests\media_library\FunctionalJavascript

Code

protected function assertAnnounceContains(string $expected_message) : void {
    $assert_session = $this->assertSession();
    $this->assertNotEmpty($assert_session->waitForElement('css', "#drupal-live-announce:contains('{$expected_message}')"));
}

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