1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 00:54:49 +02:00

Fixes #5396 toVideo dimensions.

This commit is contained in:
camer0n
2025-01-16 11:23:25 -08:00
parent e8f5e804b2
commit cd30dfdc0d
3 changed files with 43 additions and 5 deletions

View File

@@ -2680,11 +2680,43 @@ Your browser does not support the audio tag.
}
/*
public function testToVideo()
{
}*/
public function testToVideo()
{
$tests = [
0 => [
'file' => '{e_MEDIA}myfile.mp4',
'parms' =>[],
'expected' => '<video width="320" height="240" controls>'
],
1 => [
'file' => '{e_MEDIA}myfile.mp4',
'parms' =>['w'=>500],
'expected' => '<video width="500" height="240" controls>'
],
2 => [
'file' => '{e_MEDIA}myfile.mp4',
'parms' =>['w'=>300, 'h'=>0],
'expected' => '<video width="300" height="auto" controls>'
],
3 => [
'file' => '{e_MEDIA}myfile.mp4',
'parms' =>['w'=>300, 'h'=>'auto'],
'expected' => '<video width="300" height="auto" controls>'
],
];
foreach ($tests as $index => $var)
{
$result = $this->tp->toVideo($var['file'], $var['parms']);
self::assertStringContainsString($var['expected'], $result, 'Failed on index #'.$index);
}
}
public function testMakeClickable()
{