Beispiel #1
0
 public function testOptionsAtConstructor()
 {
     $validator = new Zend_Validate_File_IsCompressed(array('image/gif', 'image/jpg', 'magicfile' => __FILE__, 'headerCheck' => true));
     $this->assertEquals(__FILE__, $validator->getMagicFile());
     $this->assertTrue($validator->getHeaderCheck());
     $this->assertEquals('image/gif,image/jpg', $validator->getMimeType());
 }
Beispiel #2
0
 public function testOptionsAtConstructor()
 {
     if (!extension_loaded('fileinfo')) {
         $this->markTestSkipped('This PHP Version has no finfo installed');
     }
     if (version_compare(PHP_VERSION, '5.3', '>=')) {
         $magicFile = dirname(__FILE__) . '/_files/magic-php53.mime';
     } else {
         $magicFile = dirname(__FILE__) . '/_files/magic.mime';
     }
     $validator = new Zend_Validate_File_IsCompressed(array('image/gif', 'image/jpg', 'magicfile' => $magicFile, 'headerCheck' => true));
     $this->assertEquals($magicFile, $validator->getMagicFile());
     $this->assertTrue($validator->getHeaderCheck());
     $this->assertEquals('image/gif,image/jpg', $validator->getMimeType());
 }