Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2166,4 +2166,30 @@ public function testDatetime() { | |
$this->assertFalse(Validation::datetime('31 11 2006 1:00pm', 'dmy')); | ||
} | ||
|
||
/** | ||
* testMimeType method | ||
* | ||
* @return void | ||
*/ | ||
public function testMimeType() { | ||
$file = CORE_PATH . 'Cake' . DS . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif'; | ||
$this->assertTrue(Validation::mimeType($file, array('image/gif'))); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
burzum
Contributor
|
||
$this->assertTrue(Validation::mimeType(array('tmp_name' => $file), array('image/gif'))); | ||
|
||
$this->assertFalse(Validation::mimeType($file, array('image/png'))); | ||
$this->assertFalse(Validation::mimeType(array('tmp_name' => $file), array('image/png'))); | ||
} | ||
|
||
/** | ||
* testMimeType method | ||
* | ||
* @return void | ||
*/ | ||
public function testUploadError() { | ||
$this->assertTrue(Validation::uploadError(0)); | ||
$this->assertTrue(Validation::uploadError(array('error' => 0))); | ||
|
||
$this->assertFalse(Validation::uploadError(2)); | ||
$this->assertFalse(Validation::uploadError(array('error' => 2))); | ||
} | ||
} |
@burzum This test has been failing since quite a while on PHP 5.2 http://travis-ci.org/#!/cakephp/cakephp/jobs/1504158