Fixed wrong tests for Italian postcodes

This commit is contained in:
Marco Chiesi 2019-04-11 00:33:30 +02:00 committed by GitHub
parent e2dd7504d0
commit cba442283c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -48,12 +48,11 @@ class WC_Tests_Validation extends WC_Unit_Test_Case {
* @since 2.4
*/
public function data_provider_test_is_postcode() {
$generic = array(
$it = array(
array( true, WC_Validation::is_postcode( '99999', 'IT' ) ),
array( true, WC_Validation::is_postcode( '99999', 'IT' ) ),
array( true, WC_Validation::is_postcode( '9999', 'IT' ) ),
array( true, WC_Validation::is_postcode( 'ABC 999', 'IT' ) ),
array( true, WC_Validation::is_postcode( 'ABC-999', 'IT' ) ),
array( false, WC_Validation::is_postcode( '9999', 'IT' ) ),
array( false, WC_Validation::is_postcode( 'ABC 999', 'IT' ) ),
array( false, WC_Validation::is_postcode( 'ABC-999', 'IT' ) ),
array( false, WC_Validation::is_postcode( 'ABC_123', 'IT' ) ),
);
@ -92,7 +91,7 @@ class WC_Tests_Validation extends WC_Unit_Test_Case {
array( false, WC_Validation::is_postcode( '0A0A0A', 'CA' ) ),
);
return array_merge( $generic, $gb, $us, $ch, $br, $ca );
return array_merge( $it, $gb, $us, $ch, $br, $ca );
}
/**