From c38419e33a5df85435ba9ac1b5aed620081452bb Mon Sep 17 00:00:00 2001 From: Ceeram Date: Mon, 19 Mar 2012 09:51:40 +0100 Subject: [PATCH] Fixing test, some 5.2 installs do not have function to read mime --- lib/Cake/Test/Case/Utility/FileTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Cake/Test/Case/Utility/FileTest.php b/lib/Cake/Test/Case/Utility/FileTest.php index eba7422f7..8ba6b5872 100644 --- a/lib/Cake/Test/Case/Utility/FileTest.php +++ b/lib/Cake/Test/Case/Utility/FileTest.php @@ -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());