function MediaLibraryTestBase::selectMediaItem
Same name in other branches
- 8.9.x core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::selectMediaItem()
- 10 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::selectMediaItem()
- 11.x core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::selectMediaItem()
Selects an item in the media library modal.
Parameters
int $index: The zero-based index of the item to select.
string $expected_selected_count: (optional) The expected text of the selection counter.
4 calls to MediaLibraryTestBase::selectMediaItem()
- EntityReferenceWidgetTest::testAddAfterReordering in core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ EntityReferenceWidgetTest.php - Tests that order is correct after re-order and adding another item.
- EntityReferenceWidgetTest::testRequiredMediaField in core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ EntityReferenceWidgetTest.php - Tests saving a required media library field.
- EntityReferenceWidgetTest::testWidget in core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ EntityReferenceWidgetTest.php - Tests that the Media library's widget works as expected.
- WidgetAnonymousTest::testWidgetAnonymous in core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ WidgetAnonymousTest.php - Tests that the widget works as expected for anonymous users.
File
-
core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ MediaLibraryTestBase.php, line 393
Class
- MediaLibraryTestBase
- Base class for functional tests of Media Library functionality.
Namespace
Drupal\Tests\media_library\FunctionalJavascriptCode
protected function selectMediaItem($index, $expected_selected_count = NULL) {
$checkboxes = $this->getCheckboxes();
$this->assertGreaterThan($index, count($checkboxes));
$checkboxes[$index]->check();
if ($expected_selected_count) {
$this->assertSelectedMediaCount($expected_selected_count);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.