From 66b79689488399d5f31a60028c3ae64d93e0ea2e Mon Sep 17 00:00:00 2001 From: newman101 Date: Fri, 6 Nov 2015 20:33:23 +0000 Subject: [PATCH 1/2] Added en_AU unit test support --- test/Faker/Provider/en_AU/PhoneNumberTest.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/Faker/Provider/en_AU/PhoneNumberTest.php diff --git a/test/Faker/Provider/en_AU/PhoneNumberTest.php b/test/Faker/Provider/en_AU/PhoneNumberTest.php new file mode 100644 index 0000000000..fe3c7f5983 --- /dev/null +++ b/test/Faker/Provider/en_AU/PhoneNumberTest.php @@ -0,0 +1,28 @@ +addProvider(new PhoneNumber($faker)); + $this->faker = $faker; + } + + public function testPhoneNumberCanReturnData() + { + $number = $this->faker->phoneNumber; + $this->assertNotEmpty($number); + } +} From 6555a657443458deeef4b48368078c91767b44b9 Mon Sep 17 00:00:00 2001 From: Juha Remes Date: Fri, 6 Nov 2015 22:39:45 +0000 Subject: [PATCH 2/2] Add testPhoneNumberFormat method to en_AU unit test class --- test/Faker/Provider/en_AU/PhoneNumberTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/Faker/Provider/en_AU/PhoneNumberTest.php b/test/Faker/Provider/en_AU/PhoneNumberTest.php index fe3c7f5983..7f43e84c6b 100644 --- a/test/Faker/Provider/en_AU/PhoneNumberTest.php +++ b/test/Faker/Provider/en_AU/PhoneNumberTest.php @@ -25,4 +25,10 @@ public function testPhoneNumberCanReturnData() $number = $this->faker->phoneNumber; $this->assertNotEmpty($number); } + + public function testPhoneNumberFormat() + { + $number = $this->faker->phoneNumber; + $this->assertRegExp('/^(?:\+?61|0)[2-478](?:[ -]?[0-9]){8}$/', $number); + } }