예제 #1
0
 /**
  * Test that mimeType() returns true if the mimetype of a file is within the whitelist.
  */
 public function testMimeType()
 {
     $this->assertTrue(Validate::mimeType($this->image, array('image/jpeg', 'image/jpg')));
     $this->assertFalse(Validate::mimeType($this->image, array('image/gif')));
     $this->assertTrue(Validate::mimeType(array('tmp_name' => $this->image, 'error' => 0), array('image/jpeg', 'image/jpg')));
     $this->assertFalse(Validate::mimeType(array('tmp_name' => 'fake.jpg', 'error' => 0), array('image/gif')));
 }