fix(BankPaymentValidator): check for negative identification number
This commit is contained in:
		
							parent
							
								
									bf65ce058d
								
							
						
					
					
						commit
						deacc6024b
					
				@ -24,7 +24,7 @@ class BankPaymentIdentificationNumberValidator extends ConstraintValidator
 | 
			
		||||
            throw new UnexpectedValueException($value, "string");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (strlen($value) <= 10 && filter_var($value, FILTER_VALIDATE_INT) !== false) {
 | 
			
		||||
        if (strlen($value) <= 10 && filter_var($value, FILTER_VALIDATE_INT) !== false && (int) $value > 0) {
 | 
			
		||||
            return ;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -35,6 +35,6 @@ class BankPaymentIdentificationNumberValidatorTest extends ValidatorTestCase
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private function failureDp(): array {
 | 
			
		||||
        return [['122.b'], ['a.a'], ['a'], ['2.040'], ['2,a'], ['122.1'], ['12345678901']];
 | 
			
		||||
        return [['122.b'], ['a.a'], ['a'], ['2.040'], ['2,a'], ['122.1'], ['12345678901'], ['-323']];
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user