protected function MediaLibraryTestBase::assertSelectedMediaCount in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::assertSelectedMediaCount()
- 9 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::assertSelectedMediaCount()
Asserts the current text of the selected item counter.
Parameters
string $text: The expected text of the counter.
File
- core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ MediaLibraryTestBase.php, line 449
Class
- MediaLibraryTestBase
- Base class for functional tests of Media Library functionality.
Namespace
Drupal\Tests\media_library\FunctionalJavascriptCode
protected function assertSelectedMediaCount($text) {
$selected_count = $this
->assertSession()
->elementExists('css', '.js-media-library-selected-count');
$this
->assertSame('status', $selected_count
->getAttribute('role'));
$this
->assertSame('polite', $selected_count
->getAttribute('aria-live'));
$this
->assertSame('true', $selected_count
->getAttribute('aria-atomic'));
$this
->assertSame($text, $selected_count
->getText());
}