Skip to content

Commit 3b6efaf

Browse files
Merge pull request #3050 from klaaspieter/fix-nl-phone-format
Fix nl phone format
2 parents 7be00c0 + 07bb57e commit 3b6efaf

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/locales/nl.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,15 @@ nl:
8383
- "#{first_name} #{last_name} #{last_name}"
8484

8585
phone_number:
86-
formats: ["(####) ######", "##########", "06########", "06 #### ####"]
86+
country_code:
87+
- '31'
88+
formats:
89+
- "(####) ######"
90+
- "##########"
91+
cell_phone:
92+
formats:
93+
- "06########"
94+
- "06 #### ####"
8795

8896
university:
8997
prefix: [Universiteit, Hogeschool]

test/test_nl_locale.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ def test_nl_phone_number_methods
6565
assert_kind_of String, Faker::PhoneNumber.cell_phone
6666
end
6767

68+
def test_nl_cell_phone_countrycode
69+
mobile = Faker::PhoneNumber.cell_phone_with_country_code.gsub(/\D/, '')
70+
71+
assert_match(/^(0|31)/, mobile)
72+
end
73+
6874
def test_nl_university_methods
6975
assert_kind_of String, Faker::University.prefix
7076
assert_kind_of String, Faker::University.name

0 commit comments

Comments
 (0)