mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
parent
0cdfed0aee
commit
c26b7bbffe
2 changed files with 20 additions and 20 deletions
|
@ -400,7 +400,7 @@ class ModelTaskTest extends CakeTestCase {
|
||||||
public function testInteractiveDoValidationWithSkipping() {
|
public function testInteractiveDoValidationWithSkipping() {
|
||||||
$this->Task->expects($this->any())
|
$this->Task->expects($this->any())
|
||||||
->method('in')
|
->method('in')
|
||||||
->will($this->onConsecutiveCalls('34', '24', 'n', '10', 's'));
|
->will($this->onConsecutiveCalls('35', '24', 'n', '10', 's'));
|
||||||
$this->Task->interactive = true;
|
$this->Task->interactive = true;
|
||||||
$Model = $this->getMock('Model');
|
$Model = $this->getMock('Model');
|
||||||
$Model->primaryKey = 'id';
|
$Model->primaryKey = 'id';
|
||||||
|
|
|
@ -1038,25 +1038,25 @@ class Validation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate an uploaded file.
|
* Validate an uploaded file.
|
||||||
*
|
*
|
||||||
* Helps join `uploadError`, `fileSize` and `mimeType` into
|
* Helps join `uploadError`, `fileSize` and `mimeType` into
|
||||||
* one higher level validation method.
|
* one higher level validation method.
|
||||||
*
|
*
|
||||||
* ### Options
|
* ### Options
|
||||||
*
|
*
|
||||||
* - `types` - A list of valid mime types. If empty all types
|
* - `types` - A list of valid mime types. If empty all types
|
||||||
* will be accepted. The `type` will not be looked at, instead
|
* will be accepted. The `type` will not be looked at, instead
|
||||||
* the file type will be checked with ext/finfo.
|
* the file type will be checked with ext/finfo.
|
||||||
* - `minSize` - The minimum file size. Defaults to not checking.
|
* - `minSize` - The minimum file size. Defaults to not checking.
|
||||||
* - `maxSize` - The maximum file size. Defaults to not checking.
|
* - `maxSize` - The maximum file size. Defaults to not checking.
|
||||||
* - `optional` - Whether or not this file is optional. Defaults to false.
|
* - `optional` - Whether or not this file is optional. Defaults to false.
|
||||||
* If true a missing file will pass the validator regardless of other constraints.
|
* If true a missing file will pass the validator regardless of other constraints.
|
||||||
*
|
*
|
||||||
* @param array $file The uploaded file data from PHP.
|
* @param array $file The uploaded file data from PHP.
|
||||||
* @param array $options An array of options for the validation.
|
* @param array $options An array of options for the validation.
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function uploadedFile($file, $options = array()) {
|
public static function uploadedFile($file, $options = array()) {
|
||||||
$options += array(
|
$options += array(
|
||||||
'minSize' => null,
|
'minSize' => null,
|
||||||
|
|
Loading…
Reference in a new issue