Example #1
0
 function testGuessTypeParanoid()
 {
     $this->skipUnless(extension_loaded('fileinfo'), '%s. Fileinfo extension not loaded.');
     MimeType::config('magic', array('engine' => 'fileinfo'));
     MimeType::config('glob', array('engine' => 'core', 'file' => dirname(dirname(dirname(dirname(__FILE__)))) . DS . 'vendors' . DS . 'mime_glob.db'));
     $file = $this->TestData->getFile(array('image-png.png' => TMP . 'image-png.jpg'));
     $this->assertEqual(MimeType::guessType($file, array('paranoid' => true)), 'image/png');
     $this->assertEqual(MimeType::guessType($file, array('paranoid' => false)), 'image/jpeg');
 }