Update Korean postal code validation

The Korea Postal code system changed from a 6-digit postal code system
to a 5-digit postal code system on August 1, 2015 [1] [2].

This commit makes sure that the "PostalCode" rule validates Korean
postal codes correctly.

[1]: http://www.fedex.com/ky/koreapostalcode/index.html
[2]: http://www.epost.go.kr/roadAreaCdEng.retrieveLnEngAreaCdList.comm

Co-authored-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
ong-ar 2018-09-19 17:38:39 +09:00 committed by Henrique Moody
parent 203f8e7e9d
commit 892b39e5ff
No known key found for this signature in database
GPG key ID: 221E9281655813A6
2 changed files with 4 additions and 1 deletions

View file

@ -96,7 +96,7 @@ class PostalCode extends Regex
'KG' => '/^(\d{6})$/',
'KH' => '/^(\d{5})$/',
'KP' => '/^(\d{6})$/',
'KR' => '/^(?:SEOUL)*(\d{6})$/',
'KR' => '/^(\d{5})$/',
'KW' => '/^(\d{5})$/',
'KZ' => '/^(\d{6})$/',
'LA' => '/^(\d{5})$/',

View file

@ -96,6 +96,7 @@ class PostalCodeTest extends \PHPUnit_Framework_TestCase
['PT', '3660-606'],
['PT', '3660606'],
['CO', '110231'],
['KR', '03187'],
];
}
@ -130,6 +131,8 @@ class PostalCodeTest extends \PHPUnit_Framework_TestCase
['US', '021 79'],
['YE', '02179'],
['PL', '99300'],
['KR', '548940'],
['KR', '548-940'],
];
}
}