Exemple #1
0
 public function baseCheck()
 {
     $errors = parent::baseCheck();
     switch ($this->cleanedValue->getError()) {
         case UPLOAD_ERR_OK:
             break;
         case UPLOAD_ERR_NO_FILE:
             $errors[] = 'No se envió el archivo';
         case UPLOAD_ERR_INI_SIZE:
         case UPLOAD_ERR_FORM_SIZE:
             $errors[] = 'El archivo es muy grande';
         default:
             $errors[] = 'Error desconocido';
     }
     return $errors;
 }
Exemple #2
0
 public function testRequiredContinuesWorkingWithNmspace()
 {
     $v = new Validator('bar');
     $v->nmspace('foo')->required();
     $input = array();
     $this->setExpectedException('Phpiv\\ValidationError');
     $v->check($input);
 }