public function testNonMimeOptionsAtConstructorStillSetsDefaults()
    {
        $validator = new File\IsCompressed(array(
            'enableHeaderCheck' => true,
        ));

        $this->assertNotEmpty($validator->getMimeType());
    }
Beispiel #2
0
 public function testOptionsAtConstructor()
 {
     if (!extension_loaded('fileinfo')) {
         $this->markTestSkipped('This PHP Version has no finfo installed');
     }
     $magicFile = dirname(__FILE__) . '/_files/magic.mime';
     $validator = new 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());
 }
Beispiel #3
0
 public function testOptionsAtConstructor()
 {
     $this->markTestSkipped('magicFile current throws error if not validate, test needs to be rewritten');
     $validator = new 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());
 }