You are here

protected function MediaLibraryAddFormTest::buildLibraryUi in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php \Drupal\Tests\media_library\Kernel\MediaLibraryAddFormTest::buildLibraryUi()

Build the media library UI for a selected type.

Parameters

string $selected_type_id: The selected media type ID.

Return value

array The render array for the media library.

File

core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php, line 114

Class

MediaLibraryAddFormTest
Tests the media library add form.

Namespace

Drupal\Tests\media_library\Kernel

Code

protected function buildLibraryUi($selected_type_id) {
  $state = MediaLibraryState::create('test', [
    'image',
    'remote_video',
  ], $selected_type_id, -1);
  return \Drupal::service('media_library.ui_builder')
    ->buildUi($state);
}