From 1839feae91064f66356b09af9df9def25f491ef5 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 12 Aug 2020 18:50:25 -0300 Subject: [PATCH] Added unit tests for #27244 --- tests/legacy/unit-tests/util/validation.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/legacy/unit-tests/util/validation.php b/tests/legacy/unit-tests/util/validation.php index 1c08b029582..21827b43d35 100644 --- a/tests/legacy/unit-tests/util/validation.php +++ b/tests/legacy/unit-tests/util/validation.php @@ -123,7 +123,15 @@ class WC_Tests_Validation extends WC_Unit_Test_Case { array( false, WC_Validation::is_postcode( '7850', 'BA' ) ), ); - return array_merge( $it, $gb, $us, $ch, $br, $ca, $nl, $si, $ba ); + $jp = array( + array( true, WC_Validation::is_postcode( '1340088', 'JP' ) ), + array( true, WC_Validation::is_postcode( '134-0088', 'JP' ) ), + array( false, WC_Validation::is_postcode( '1340-088', 'JP' ) ), + array( false, WC_Validation::is_postcode( '12345', 'JP' ) ), + array( false, WC_Validation::is_postcode( '0123', 'JP' ) ), + ); + + return array_merge( $it, $gb, $us, $ch, $br, $ca, $nl, $si, $ba, $jp ); } /**