1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 03:24:20 +02:00

Fixes #5387 - Avatar mime type on remote image.

This commit is contained in:
camer0n
2025-01-13 15:35:28 -08:00
parent 6aa42ccad9
commit b51833b794
2 changed files with 23 additions and 7 deletions

View File

@@ -2433,16 +2433,24 @@ EXPECTED;
'alt="mytitle"',
)
),
/** @fixme - doesn't pass under CLI */
/*
7 => array(
'input' => array('user_image'=>'avatartest.png'),
'parms' => array('w'=>50, 'h'=>50, 'crop'=>true, 'base64'=>true, 'shape'=>'circle'),
'expected' => array(
"src='data:image/png;base64,",
"class='img-circle user-avatar'"
"class='img-circle rounded-circle user-avatar'"
)
),*/
),
8 => array(
'input' => array('user_image'=>'https://e107.org/e107_images/generic/blank_avatar.jpg'), // Test remote avatar
'parms' => array('w'=>50, 'h'=>50, 'crop'=>true, 'base64'=>true, 'shape'=>'circle'),
'expected' => array(
"src='data:image/jpg;base64,",
"class='img-circle rounded-circle user-avatar'"
)
),
);
@@ -2452,7 +2460,7 @@ EXPECTED;
$result = $this->tp->toAvatar($var['input'], $var['parms']);
foreach ($var['expected'] as $str)
{
$this->assertStringContainsString($str, $result, "Failed on index #" . $index);
self::assertStringContainsString($str, $result, "Failed on index #" . $index);
}
}