function MediaLibraryAddFormTest::buildLibraryUi

Same name and namespace in other branches
  1. 8.9.x core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php \Drupal\Tests\media_library\Kernel\MediaLibraryAddFormTest::buildLibraryUi()
  2. 10 core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php \Drupal\Tests\media_library\Kernel\MediaLibraryAddFormTest::buildLibraryUi()
  3. 11.x 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);
}

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