示例#1
0
 public function testNonMimeOptionsAtConstructorStillSetsDefaults()
 {
     $validator = new File\IsImage(array('enableHeaderCheck' => true));
     $this->assertNotEmpty($validator->getMimeType());
 }
示例#2
0
    public function testOptionsAtConstructor()
    {
        if (!extension_loaded('fileinfo')) {
            $this->markTestSkipped('This PHP Version has no finfo installed');
        }

        $magicFile = $this->getMagicMime();
        $validator = new File\IsImage(array(
            'image/gif',
            'image/jpg',
            'magicFile'   => $magicFile,
            'enableHeaderCheck' => true));

        $this->assertEquals($magicFile, $validator->getMagicFile());
        $this->assertTrue($validator->getHeaderCheck());
        $this->assertEquals('image/gif,image/jpg', $validator->getMimeType());
    }
示例#3
0
 public function testOptionsAtConstructor()
 {
     $this->markTestSkipped('magicFile current throws error if not validate, test needs to be rewritten');
     $validator = new File\IsImage(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());
 }