New tests for is_postcode with NL postcodes

This commit is contained in:
Claudio Sanches 2019-05-28 20:55:51 -03:00
parent e04e9ae521
commit 2f7ec9506f
1 changed files with 10 additions and 1 deletions

View File

@ -98,7 +98,16 @@ class WC_Tests_Validation extends WC_Unit_Test_Case {
array( false, WC_Validation::is_postcode( '0A0A0A', 'CA' ) ),
);
return array_merge( $it, $gb, $us, $ch, $br, $ca );
$nl = array(
array( true, WC_Validation::is_postcode( '3852GC', 'NL' ) ),
array( true, WC_Validation::is_postcode( '3852 GC', 'NL' ) ),
array( true, WC_Validation::is_postcode( '3852 gc', 'NL' ) ),
array( false, WC_Validation::is_postcode( '3852SA', 'NL' ) ),
array( false, WC_Validation::is_postcode( '3852 SA', 'NL' ) ),
array( false, WC_Validation::is_postcode( '3852 sa', 'NL' ) ),
);
return array_merge( $it, $gb, $us, $ch, $br, $ca, $nl );
}
/**