mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fixing test, some 5.2 installs do not have function to read mime
This commit is contained in:
parent
94b3839b2e
commit
c38419e33a
1 changed files with 5 additions and 0 deletions
|
@ -80,6 +80,10 @@ class FileTest extends CakeTestCase {
|
|||
'filesize' => filesize($file),
|
||||
'mime' => 'text/x-php'
|
||||
);
|
||||
if (!function_exists('finfo_open') && !function_exists('mime_content_type')) {
|
||||
$expecting['mime'] = false;
|
||||
}
|
||||
|
||||
$this->assertEquals($expecting, $result);
|
||||
|
||||
$result = $this->File->ext();
|
||||
|
@ -473,6 +477,7 @@ class FileTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testMime() {
|
||||
$this->skipIf(!function_exists('finfo_open') && !function_exists('mime_content_type'), 'Not able to read mime type');
|
||||
$path = CAKE . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif';
|
||||
$file = new File($path);
|
||||
$this->assertEquals('image/gif', $file->mime());
|
||||
|
|
Loading…
Add table
Reference in a new issue