mirror of
https://github.com/e107inc/e107.git
synced 2025-08-13 10:04:35 +02:00
Hero cleanup for Bootstrap5. Switched to placeholder images. Admin-ui type 'image' now loads remote URLs correctly.
This commit is contained in:
@@ -340,12 +340,40 @@
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
public function testDetectType()
|
||||
{
|
||||
$tests = array(
|
||||
0 => array(
|
||||
'input' => 'gallery/images/butterfly.jpg',
|
||||
'expected' => 'image'
|
||||
),
|
||||
1 => array(
|
||||
'input' => 'myfile.mov',
|
||||
'expected' => 'video'
|
||||
),
|
||||
2 => array(
|
||||
'input' => 'myfile.mp4',
|
||||
'expected' => 'video'
|
||||
),
|
||||
3 => array(
|
||||
'input' => 'https://via.placeholder.com/728x90.png?text=Label',
|
||||
'expected' => 'image'
|
||||
),
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
foreach($tests as $index => $var)
|
||||
{
|
||||
$result = $this->md->detectType($var['input']);
|
||||
$this->assertSame($var['expected'], $result, 'Failed on index #'.$index. ': '.$var['input']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
public function testGetVideos()
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user