From 4b31b8237fb3b70c8a9a96100e6a6d3142bb9145 Mon Sep 17 00:00:00 2001 From: newman101 Date: Wed, 11 Nov 2015 12:21:18 +0000 Subject: [PATCH] Added en_NZ unit test folder + PhoneNumberTest.php --- test/Faker/Provider/en_NZ/PhoneNumberTest.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/Faker/Provider/en_NZ/PhoneNumberTest.php diff --git a/test/Faker/Provider/en_NZ/PhoneNumberTest.php b/test/Faker/Provider/en_NZ/PhoneNumberTest.php new file mode 100644 index 0000000000..f8a8f6cfbe --- /dev/null +++ b/test/Faker/Provider/en_NZ/PhoneNumberTest.php @@ -0,0 +1,35 @@ +addProvider(new PhoneNumber($faker)); + $this->faker = $faker; + } + + public function testIfPhoneNumberCanReturnData() + { + $number = $this->faker->phoneNumber; + $this->assertNotEmpty($number); + } + + public function phoneNumberFormat() + { + $number = $this->faker->phoneNumber; + $this->assertRegExp('/(^\([0]\d{1}\))(\d{7}$)|(^\([0][2]\d{1}\))(\d{6,8}$)|([0][8][0][0])([\s])(\d{5,8}$)/', $number); + } +} +?>