diff --git a/tests/src/Kernel/FieldOutputTest.php b/tests/src/Kernel/FieldOutputTest.php index 109197a..5ce00a5 100644 --- a/tests/src/Kernel/FieldOutputTest.php +++ b/tests/src/Kernel/FieldOutputTest.php @@ -21,356 +21,356 @@ class FieldOutputTest extends KernelTestBase { */ public function renderedFieldTestCases() { return [ -// 'YouTube: Thumbnail' => [ -// 'https://www.youtube.com/watch?v=fdbFVWupSsw', -// [ -// 'type' => 'video_embed_field_thumbnail', -// 'settings' => [], -// ], -// [ -// '#theme' => 'image', -// '#uri' => 'public://video_thumbnails/fdbFVWupSsw.jpg', -// ], -// ], -// 'YouTube: Thumbnail With Image Style' => [ -// 'https://www.youtube.com/watch?v=fdbFVWupSsw', -// [ -// 'type' => 'video_embed_field_thumbnail', -// 'settings' => [ -// 'image_style' => 'thumbnail', -// ], -// ], -// [ -// '#theme' => 'image_style', -// '#uri' => 'public://video_thumbnails/fdbFVWupSsw.jpg', -// '#style_name' => 'thumbnail', -// ], -// ], -// 'YouTube: Embed Code' => [ -// 'https://www.youtube.com/watch?v=fdbFVWupSsw', -// [ -// 'type' => 'video_embed_field_video', -// 'settings' => [ -// 'width' => 100, -// 'height' => 100, -// 'autoplay' => TRUE, -// 'responsive' => FALSE, -// ], -// ], -// [ -// '#type' => 'container', -// '#attributes' => [ -// 'class' => [ -// 'video-embed-field-provider-youtube', -// ], -// ], -// 'children' => [ -// '#type' => 'video_embed_iframe', -// '#provider' => 'youtube', -// '#url' => 'https://www.youtube.com/embed/fdbFVWupSsw', -// '#query' => [ -// 'autoplay' => '1', -// 'start' => '0', -// 'rel' => '0', -// ], -// '#attributes' => [ -// 'width' => '100', -// 'height' => '100', -// 'frameborder' => '0', -// 'allowfullscreen' => 'allowfullscreen', -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// ], -// ], -// ], -// 'YouTube: Time-index Embed Code' => [ -// 'https://www.youtube.com/watch?v=fdbFVWupSsw&t=100', -// [ -// 'type' => 'video_embed_field_video', -// 'settings' => [ -// 'width' => 100, -// 'height' => 100, -// 'autoplay' => TRUE, -// 'responsive' => FALSE, -// ], -// ], -// [ -// '#type' => 'container', -// '#attributes' => [ -// 'class' => [ -// 'video-embed-field-provider-youtube', -// ], -// ], -// 'children' => [ -// '#type' => 'video_embed_iframe', -// '#provider' => 'youtube', -// '#url' => 'https://www.youtube.com/embed/fdbFVWupSsw', -// '#query' => [ -// 'autoplay' => '1', -// 'start' => '100', -// 'rel' => '0', -// ], -// '#attributes' => [ -// 'width' => '100', -// 'height' => '100', -// 'frameborder' => '0', -// 'allowfullscreen' => 'allowfullscreen', -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// ], -// ], -// ], -// 'YouTube: Language Specified Embed Code' => [ -// 'https://www.youtube.com/watch?v=fdbFVWupSsw&hl=fr', -// [ -// 'type' => 'video_embed_field_video', -// 'settings' => [ -// 'width' => 100, -// 'height' => 100, -// 'autoplay' => TRUE, -// 'responsive' => FALSE, -// ], -// ], -// [ -// '#type' => 'container', -// '#attributes' => [ -// 'class' => [ -// 'video-embed-field-provider-youtube', -// ], -// ], -// 'children' => [ -// '#type' => 'video_embed_iframe', -// '#provider' => 'youtube', -// '#url' => 'https://www.youtube.com/embed/fdbFVWupSsw', -// '#query' => [ -// 'autoplay' => '1', -// 'start' => '0', -// 'rel' => '0', -// 'cc_lang_pref' => 'fr', -// ], -// '#attributes' => [ -// 'width' => '100', -// 'height' => '100', -// 'frameborder' => '0', -// 'allowfullscreen' => 'allowfullscreen', -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// ], -// ], -// ], -// 'Vimeo: Thumbnail' => [ -// 'https://vimeo.com/80896303', -// [ -// 'type' => 'video_embed_field_thumbnail', -// 'settings' => [], -// ], -// [ -// '#theme' => 'image', -// '#uri' => 'public://video_thumbnails/80896303.jpg', -// ], -// ], -// 'Vimeo: Embed Code' => [ -// 'https://vimeo.com/80896303', -// [ -// 'type' => 'video_embed_field_video', -// 'settings' => [ -// 'width' => 100, -// 'height' => 100, -// 'autoplay' => TRUE, -// 'responsive' => FALSE, -// ], -// ], -// [ -// '#type' => 'container', -// '#attributes' => [ -// 'class' => [ -// 'video-embed-field-provider-vimeo', -// ], -// ], -// 'children' => [ -// '#type' => 'video_embed_iframe', -// '#provider' => 'vimeo', -// '#url' => 'https://player.vimeo.com/video/80896303', -// '#query' => [ -// 'autoplay' => '1', -// ], -// '#attributes' => [ -// 'width' => '100', -// 'height' => '100', -// 'frameborder' => '0', -// 'allowfullscreen' => 'allowfullscreen', -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// ], -// ], -// ], -// 'Vimeo: Autoplaying Embed Code' => [ -// 'https://vimeo.com/80896303#t=150s', -// [ -// 'type' => 'video_embed_field_video', -// 'settings' => [ -// 'width' => 100, -// 'height' => 100, -// 'autoplay' => TRUE, -// 'responsive' => FALSE, -// ], -// ], -// [ -// '#type' => 'container', -// '#attributes' => [ -// 'class' => [ -// 'video-embed-field-provider-vimeo', -// ], -// ], -// 'children' => [ -// '#type' => 'video_embed_iframe', -// '#provider' => 'vimeo', -// '#url' => 'https://player.vimeo.com/video/80896303', -// '#query' => [ -// 'autoplay' => '1', -// ], -// '#fragment' => 't=150s', -// '#attributes' => [ -// 'width' => '100', -// 'height' => '100', -// 'frameborder' => '0', -// 'allowfullscreen' => 'allowfullscreen', -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// ], -// ], -// ], -// 'Linked Thumbnail: Content' => [ -// 'https://vimeo.com/80896303', -// [ -// 'type' => 'video_embed_field_thumbnail', -// 'settings' => ['link_image_to' => Thumbnail::LINK_CONTENT], -// ], -// [ -// '#type' => 'link', -// '#title' => [ -// '#theme' => 'image', -// '#uri' => 'public://video_thumbnails/80896303.jpg', -// ], -// '#url' => 'entity.entity_test.canonical', -// ], -// ], -// 'Linked Thumbnail: Provider' => [ -// 'https://vimeo.com/80896303', -// [ -// 'type' => 'video_embed_field_thumbnail', -// 'settings' => ['link_image_to' => Thumbnail::LINK_PROVIDER], -// ], -// [ -// '#type' => 'link', -// '#title' => [ -// '#theme' => 'image', -// '#uri' => 'public://video_thumbnails/80896303.jpg', -// ], -// '#url' => 'https://vimeo.com/80896303', -// ], -// ], -// 'Colorbox Modal: Linked Image & Autoplay' => [ -// 'https://vimeo.com/80896303', -// [ -// 'type' => 'video_embed_field_colorbox', -// 'settings' => [ -// 'link_image_to' => Thumbnail::LINK_PROVIDER, -// 'autoplay' => TRUE, -// 'width' => 500, -// 'height' => 500, -// 'responsive' => FALSE, -// ], -// ], -// [ -// '#type' => 'container', -// '#attributes' => [ -// 'data-video-embed-field-modal' => '
', -// 'class' => ['video-embed-field-launch-modal'], -// ], -// '#attached' => [ -// 'library' => [ -// 'video_embed_field/colorbox', -// 'video_embed_field/responsive-video', -// ], -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// 'children' => [ -// '#type' => 'link', -// '#title' => [ -// '#theme' => 'image', -// '#uri' => 'public://video_thumbnails/80896303.jpg', -// ], -// '#url' => 'https://vimeo.com/80896303', -// ], -// ], -// ], -// 'Colorbox Modal: Responsive' => [ -// 'https://vimeo.com/80896303', -// [ -// 'type' => 'video_embed_field_colorbox', -// 'settings' => [ -// 'link_image_to' => Thumbnail::LINK_PROVIDER, -// 'autoplay' => TRUE, -// 'width' => 900, -// 'height' => 450, -// 'responsive' => TRUE, -// 'modal_max_width' => 999, -// ], -// ], -// [ -// '#type' => 'container', -// '#attributes' => [ -// 'data-video-embed-field-modal' => '', -// 'class' => [ -// 'video-embed-field-launch-modal', -// ], -// ], -// '#attached' => [ -// 'library' => [ -// 'video_embed_field/colorbox', -// 'video_embed_field/responsive-video', -// ], -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// 'children' => [ -// '#type' => 'link', -// '#title' => [ -// '#theme' => 'image', -// '#uri' => 'public://video_thumbnails/80896303.jpg', -// ], -// '#url' => 'https://vimeo.com/80896303', -// ], -// ], -// ], + 'YouTube: Thumbnail' => [ + 'https://www.youtube.com/watch?v=fdbFVWupSsw', + [ + 'type' => 'video_embed_field_thumbnail', + 'settings' => [], + ], + [ + '#theme' => 'image', + '#uri' => 'public://video_thumbnails/fdbFVWupSsw.jpg', + ], + ], + 'YouTube: Thumbnail With Image Style' => [ + 'https://www.youtube.com/watch?v=fdbFVWupSsw', + [ + 'type' => 'video_embed_field_thumbnail', + 'settings' => [ + 'image_style' => 'thumbnail', + ], + ], + [ + '#theme' => 'image_style', + '#uri' => 'public://video_thumbnails/fdbFVWupSsw.jpg', + '#style_name' => 'thumbnail', + ], + ], + 'YouTube: Embed Code' => [ + 'https://www.youtube.com/watch?v=fdbFVWupSsw', + [ + 'type' => 'video_embed_field_video', + 'settings' => [ + 'width' => 100, + 'height' => 100, + 'autoplay' => TRUE, + 'responsive' => FALSE, + ], + ], + [ + '#type' => 'container', + '#attributes' => [ + 'class' => [ + 'video-embed-field-provider-youtube', + ], + ], + 'children' => [ + '#type' => 'video_embed_iframe', + '#provider' => 'youtube', + '#url' => 'https://www.youtube.com/embed/fdbFVWupSsw', + '#query' => [ + 'autoplay' => '1', + 'start' => '0', + 'rel' => '0', + ], + '#attributes' => [ + 'width' => '100', + 'height' => '100', + 'frameborder' => '0', + 'allowfullscreen' => 'allowfullscreen', + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + ], + ], + ], + 'YouTube: Time-index Embed Code' => [ + 'https://www.youtube.com/watch?v=fdbFVWupSsw&t=100', + [ + 'type' => 'video_embed_field_video', + 'settings' => [ + 'width' => 100, + 'height' => 100, + 'autoplay' => TRUE, + 'responsive' => FALSE, + ], + ], + [ + '#type' => 'container', + '#attributes' => [ + 'class' => [ + 'video-embed-field-provider-youtube', + ], + ], + 'children' => [ + '#type' => 'video_embed_iframe', + '#provider' => 'youtube', + '#url' => 'https://www.youtube.com/embed/fdbFVWupSsw', + '#query' => [ + 'autoplay' => '1', + 'start' => '100', + 'rel' => '0', + ], + '#attributes' => [ + 'width' => '100', + 'height' => '100', + 'frameborder' => '0', + 'allowfullscreen' => 'allowfullscreen', + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + ], + ], + ], + 'YouTube: Language Specified Embed Code' => [ + 'https://www.youtube.com/watch?v=fdbFVWupSsw&hl=fr', + [ + 'type' => 'video_embed_field_video', + 'settings' => [ + 'width' => 100, + 'height' => 100, + 'autoplay' => TRUE, + 'responsive' => FALSE, + ], + ], + [ + '#type' => 'container', + '#attributes' => [ + 'class' => [ + 'video-embed-field-provider-youtube', + ], + ], + 'children' => [ + '#type' => 'video_embed_iframe', + '#provider' => 'youtube', + '#url' => 'https://www.youtube.com/embed/fdbFVWupSsw', + '#query' => [ + 'autoplay' => '1', + 'start' => '0', + 'rel' => '0', + 'cc_lang_pref' => 'fr', + ], + '#attributes' => [ + 'width' => '100', + 'height' => '100', + 'frameborder' => '0', + 'allowfullscreen' => 'allowfullscreen', + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + ], + ], + ], + 'Vimeo: Thumbnail' => [ + 'https://vimeo.com/80896303', + [ + 'type' => 'video_embed_field_thumbnail', + 'settings' => [], + ], + [ + '#theme' => 'image', + '#uri' => 'public://video_thumbnails/80896303.jpg', + ], + ], + 'Vimeo: Embed Code' => [ + 'https://vimeo.com/80896303', + [ + 'type' => 'video_embed_field_video', + 'settings' => [ + 'width' => 100, + 'height' => 100, + 'autoplay' => TRUE, + 'responsive' => FALSE, + ], + ], + [ + '#type' => 'container', + '#attributes' => [ + 'class' => [ + 'video-embed-field-provider-vimeo', + ], + ], + 'children' => [ + '#type' => 'video_embed_iframe', + '#provider' => 'vimeo', + '#url' => 'https://player.vimeo.com/video/80896303', + '#query' => [ + 'autoplay' => '1', + ], + '#attributes' => [ + 'width' => '100', + 'height' => '100', + 'frameborder' => '0', + 'allowfullscreen' => 'allowfullscreen', + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + ], + ], + ], + 'Vimeo: Autoplaying Embed Code' => [ + 'https://vimeo.com/80896303#t=150s', + [ + 'type' => 'video_embed_field_video', + 'settings' => [ + 'width' => 100, + 'height' => 100, + 'autoplay' => TRUE, + 'responsive' => FALSE, + ], + ], + [ + '#type' => 'container', + '#attributes' => [ + 'class' => [ + 'video-embed-field-provider-vimeo', + ], + ], + 'children' => [ + '#type' => 'video_embed_iframe', + '#provider' => 'vimeo', + '#url' => 'https://player.vimeo.com/video/80896303', + '#query' => [ + 'autoplay' => '1', + ], + '#fragment' => 't=150s', + '#attributes' => [ + 'width' => '100', + 'height' => '100', + 'frameborder' => '0', + 'allowfullscreen' => 'allowfullscreen', + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + ], + ], + ], + 'Linked Thumbnail: Content' => [ + 'https://vimeo.com/80896303', + [ + 'type' => 'video_embed_field_thumbnail', + 'settings' => ['link_image_to' => Thumbnail::LINK_CONTENT], + ], + [ + '#type' => 'link', + '#title' => [ + '#theme' => 'image', + '#uri' => 'public://video_thumbnails/80896303.jpg', + ], + '#url' => 'entity.entity_test.canonical', + ], + ], + 'Linked Thumbnail: Provider' => [ + 'https://vimeo.com/80896303', + [ + 'type' => 'video_embed_field_thumbnail', + 'settings' => ['link_image_to' => Thumbnail::LINK_PROVIDER], + ], + [ + '#type' => 'link', + '#title' => [ + '#theme' => 'image', + '#uri' => 'public://video_thumbnails/80896303.jpg', + ], + '#url' => 'https://vimeo.com/80896303', + ], + ], + 'Colorbox Modal: Linked Image & Autoplay' => [ + 'https://vimeo.com/80896303', + [ + 'type' => 'video_embed_field_colorbox', + 'settings' => [ + 'link_image_to' => Thumbnail::LINK_PROVIDER, + 'autoplay' => TRUE, + 'width' => 500, + 'height' => 500, + 'responsive' => FALSE, + ], + ], + [ + '#type' => 'container', + '#attributes' => [ + 'data-video-embed-field-modal' => '', + 'class' => ['video-embed-field-launch-modal'], + ], + '#attached' => [ + 'library' => [ + 'video_embed_field/colorbox', + 'video_embed_field/responsive-video', + ], + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + 'children' => [ + '#type' => 'link', + '#title' => [ + '#theme' => 'image', + '#uri' => 'public://video_thumbnails/80896303.jpg', + ], + '#url' => 'https://vimeo.com/80896303', + ], + ], + ], + 'Colorbox Modal: Responsive' => [ + 'https://vimeo.com/80896303', + [ + 'type' => 'video_embed_field_colorbox', + 'settings' => [ + 'link_image_to' => Thumbnail::LINK_PROVIDER, + 'autoplay' => TRUE, + 'width' => 900, + 'height' => 450, + 'responsive' => TRUE, + 'modal_max_width' => 999, + ], + ], + [ + '#type' => 'container', + '#attributes' => [ + 'data-video-embed-field-modal' => '', + 'class' => [ + 'video-embed-field-launch-modal', + ], + ], + '#attached' => [ + 'library' => [ + 'video_embed_field/colorbox', + 'video_embed_field/responsive-video', + ], + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + 'children' => [ + '#type' => 'link', + '#title' => [ + '#theme' => 'image', + '#uri' => 'public://video_thumbnails/80896303.jpg', + ], + '#url' => 'https://vimeo.com/80896303', + ], + ], + ], 'Lazy load formatter' => [ 'https://vimeo.com/80896303', [ @@ -395,7 +395,6 @@ class FieldOutputTest extends KernelTestBase { '#attached' => [ 'library' => [ 'video_embed_field/lazy-load', - 'video_embed_field/responsive-video', ], ], '#cache' => [ @@ -424,135 +423,135 @@ class FieldOutputTest extends KernelTestBase { ], ], ], -// 'Video: Responsive' => [ -// 'https://vimeo.com/80896303', -// [ -// 'type' => 'video_embed_field_video', -// 'settings' => [ -// 'width' => 100, -// 'height' => 100, -// 'autoplay' => TRUE, -// 'responsive' => TRUE, -// ], -// ], -// [ -// '#type' => 'container', -// '#attached' => [ -// 'library' => ['video_embed_field/responsive-video'], -// ], -// '#attributes' => [ -// 'class' => [ -// 'video-embed-field-provider-vimeo', -// 'video-embed-field-responsive-video' -// ], -// ], -// 'children' => [ -// '#type' => 'video_embed_iframe', -// '#provider' => 'vimeo', -// '#url' => 'https://player.vimeo.com/video/80896303', -// '#query' => [ -// 'autoplay' => '1', -// ], -// '#attributes' => [ -// 'width' => '100', -// 'height' => '100', -// 'frameborder' => '0', -// 'allowfullscreen' => 'allowfullscreen', -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// ], -// ], -// ], -// 'YouTube Playlist' => [ -// 'https://www.youtube.com/watch?v=xoJH3qZwsHc&list=PLpeDXSh4nHjQCIZmkxg3VSdpR5e87X5eB', -// [ -// 'type' => 'video_embed_field_video', -// 'settings' => [ -// 'width' => 100, -// 'height' => 100, -// 'autoplay' => TRUE, -// 'responsive' => FALSE, -// ], -// ], -// [ -// '#type' => 'container', -// '#attributes' => [ -// 'class' => [ -// 'video-embed-field-provider-youtube-playlist', -// ], -// ], -// 'children' => [ -// '#type' => 'video_embed_iframe', -// '#provider' => 'youtube_playlist', -// '#url' => 'https://www.youtube.com/embed/videoseries', -// '#query' => [ -// 'list' => 'PLpeDXSh4nHjQCIZmkxg3VSdpR5e87X5eB', -// ], -// '#attributes' => [ -// 'width' => '100', -// 'height' => '100', -// 'frameborder' => '0', -// 'allowfullscreen' => 'allowfullscreen', -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// ], -// ], -// ], -// 'No provider (video formatter)' => [ -// 'http://example.com/not/a/video/url', -// [ -// 'type' => 'video_embed_field_video', -// 'settings' => [], -// ], -// [ -// '#theme' => 'video_embed_field_missing_provider', -// ], -// ], -// 'No provider (thumbnail formatter)' => [ -// 'http://example.com/not/a/video/url', -// [ -// 'type' => 'video_embed_field_thumbnail', -// 'settings' => [], -// ], -// [ -// '#theme' => 'video_embed_field_missing_provider', -// ], -// ], -// 'No provider (colorbox modal)' => [ -// 'http://example.com/not/a/video/url', -// [ -// 'type' => 'video_embed_field_colorbox', -// ], -// [ -// '#type' => 'container', -// '#attributes' => [ -// 'data-video-embed-field-modal' => 'No video provider was found to handle the given URL. See the documentation for more information.', -// 'class' => ['video-embed-field-launch-modal'], -// ], -// '#attached' => [ -// 'library' => [ -// 'video_embed_field/colorbox', -// 'video_embed_field/responsive-video', -// ], -// ], -// '#cache' => [ -// 'contexts' => [ -// 'user.permissions', -// ], -// ], -// 'children' => [ -// '#theme' => 'video_embed_field_missing_provider', -// ], -// ], -// ], + 'Video: Responsive' => [ + 'https://vimeo.com/80896303', + [ + 'type' => 'video_embed_field_video', + 'settings' => [ + 'width' => 100, + 'height' => 100, + 'autoplay' => TRUE, + 'responsive' => TRUE, + ], + ], + [ + '#type' => 'container', + '#attached' => [ + 'library' => ['video_embed_field/responsive-video'], + ], + '#attributes' => [ + 'class' => [ + 'video-embed-field-provider-vimeo', + 'video-embed-field-responsive-video' + ], + ], + 'children' => [ + '#type' => 'video_embed_iframe', + '#provider' => 'vimeo', + '#url' => 'https://player.vimeo.com/video/80896303', + '#query' => [ + 'autoplay' => '1', + ], + '#attributes' => [ + 'width' => '100', + 'height' => '100', + 'frameborder' => '0', + 'allowfullscreen' => 'allowfullscreen', + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + ], + ], + ], + 'YouTube Playlist' => [ + 'https://www.youtube.com/watch?v=xoJH3qZwsHc&list=PLpeDXSh4nHjQCIZmkxg3VSdpR5e87X5eB', + [ + 'type' => 'video_embed_field_video', + 'settings' => [ + 'width' => 100, + 'height' => 100, + 'autoplay' => TRUE, + 'responsive' => FALSE, + ], + ], + [ + '#type' => 'container', + '#attributes' => [ + 'class' => [ + 'video-embed-field-provider-youtube-playlist', + ], + ], + 'children' => [ + '#type' => 'video_embed_iframe', + '#provider' => 'youtube_playlist', + '#url' => 'https://www.youtube.com/embed/videoseries', + '#query' => [ + 'list' => 'PLpeDXSh4nHjQCIZmkxg3VSdpR5e87X5eB', + ], + '#attributes' => [ + 'width' => '100', + 'height' => '100', + 'frameborder' => '0', + 'allowfullscreen' => 'allowfullscreen', + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + ], + ], + ], + 'No provider (video formatter)' => [ + 'http://example.com/not/a/video/url', + [ + 'type' => 'video_embed_field_video', + 'settings' => [], + ], + [ + '#theme' => 'video_embed_field_missing_provider', + ], + ], + 'No provider (thumbnail formatter)' => [ + 'http://example.com/not/a/video/url', + [ + 'type' => 'video_embed_field_thumbnail', + 'settings' => [], + ], + [ + '#theme' => 'video_embed_field_missing_provider', + ], + ], + 'No provider (colorbox modal)' => [ + 'http://example.com/not/a/video/url', + [ + 'type' => 'video_embed_field_colorbox', + ], + [ + '#type' => 'container', + '#attributes' => [ + 'data-video-embed-field-modal' => 'No video provider was found to handle the given URL. See the documentation for more information.', + 'class' => ['video-embed-field-launch-modal'], + ], + '#attached' => [ + 'library' => [ + 'video_embed_field/colorbox', + 'video_embed_field/responsive-video', + ], + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + 'children' => [ + '#theme' => 'video_embed_field_missing_provider', + ], + ], + ], ]; }