19declare(strict_types=1);
21require_once(__DIR__ .
"/../../../../../../vendor/composer/vendor/autoload.php");
22require_once(__DIR__ .
"/../../Base.php");
36 $this->createMock(
I\
Component\Modal\InterruptiveItem\Factory::class),
37 $this->createMock(FieldFactory::class),
40 protected I\
Component\Modal\InterruptiveItem\Factory $interruptive_item_factory,
41 protected FieldFactory $field_factory,
45 public function modal(): I\Component\Modal\Factory
47 return new I\Component\Modal\Factory(
49 $this->interruptive_item_factory,
53 public function button(): I\Component\Button\Factory
55 return new I\Component\Button\Factory();
62 return new I\Component\Player\Factory();
69 $video =
$f->video(
"/foo");
71 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Player\\Video", $video);
78 $video =
$f->video(
"/foo");
80 $this->assertEquals(
"/foo", $video->getSource());
87 $video =
$f->video(
"/foo")->withPoster(
"bar.jpg");
89 $this->assertEquals(
"bar.jpg", $video->getPoster());
96 $video =
$f->video(
"/foo")->withAdditionalSubtitleFile(
"en",
"subtitles.vtt");
98 $this->assertEquals([
"en" =>
"subtitles.vtt"], $video->getSubtitleFiles());
104 $r = $this->getDefaultRenderer();
106 $video =
$f->video(
"/foo");
108 $html = $r->render($video);
110<div
class=
"il-video-container">
111 <video controls=
"controls" class=
"il-video-player" id=
"id_1" src=
"/foo" preload=
"metadata" >
115 $this->assertHTMLEquals(
116 $this->brutallyTrimHTML($expected),
117 $this->brutallyTrimHTML($html)
124 $r = $this->getDefaultRenderer();
126 $video =
$f->video(
"/foo")->withPoster(
"bar.jpg");
128 $html = $r->render($video);
130<div
class=
"il-video-container">
131 <video controls=
"controls" class=
"il-video-player" id=
"id_1" src=
"/foo" preload=
"metadata" poster=
"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style=
"background-image:url('bar.jpg')">
135 $this->assertHTMLEquals(
136 $this->brutallyTrimHTML($expected),
137 $this->brutallyTrimHTML($html)
144 $r = $this->getDefaultRenderer();
146 $video =
$f->video(
"/foo")->withAdditionalSubtitleFile(
"en",
"subtitles.vtt");
148 $html = $r->render($video);
150<div
class=
"il-video-container">
151 <video controls=
"controls" class=
"il-video-player" id=
"id_1" src=
"/foo" preload=
"metadata" >
152 <track kind=
"subtitles" src=
"subtitles.vtt" srclang=
"en" />
156 $this->assertHTMLEquals(
157 $this->brutallyTrimHTML($expected),
158 $this->brutallyTrimHTML($html)
165 $r = $this->getDefaultRenderer();
167 $video =
$f->video(
"https://www.youtube.com/embed/YSN2osYbshQ");
169 $html = $r->render($video);
172<div
class=
"il-video-container">
173 <iframe
id=
"id_1" src=
"https://www.youtube.com/embed/YSN2osYbshQ" allow=
"fullscreen; autoplay; picture-in-picture;" referrerpolicy=
"strict-origin-when-cross-origin"></iframe>
176 $this->assertHTMLEquals(
177 $this->brutallyTrimHTML($expected),
178 $this->brutallyTrimHTML($html)
185 $r = $this->getDefaultRenderer();
187 $video =
$f->video(
"https://player.vimeo.com/video/669475821");
189 $html = $r->render($video);
192<div
class=
"il-video-container">
193 <iframe
id=
"id_1" src=
"https://player.vimeo.com/video/669475821" allow=
"fullscreen; autoplay; picture-in-picture;" referrerpolicy=
"strict-origin-when-cross-origin"></iframe>
196 $this->assertHTMLEquals(
197 $this->brutallyTrimHTML($expected),
198 $this->brutallyTrimHTML($html)
Provides common functionality for UI tests.
testGetTitleGetSubtitleFile()
testRenderWithSubtitles()
testImplementsFactoryInterface()
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
modal(string $title="", string $cancel_label="")
button(string $caption, string $cmd)