From a64991ce2c6435350e73ab8349a0ba789f5a338c Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Sun, 4 Jan 2015 22:54:28 +0100 Subject: [PATCH] Code review --- src/Faker/Provider/id_ID/Address.php | 17 ----------- src/Faker/Provider/id_ID/PhoneNumber.php | 18 +++-------- test/Faker/Provider/id_ID/AddressTest.php | 37 ----------------------- test/Faker/Provider/id_ID/PersonTest.php | 36 ---------------------- 4 files changed, 5 insertions(+), 103 deletions(-) delete mode 100644 test/Faker/Provider/id_ID/AddressTest.php delete mode 100644 test/Faker/Provider/id_ID/PersonTest.php diff --git a/src/Faker/Provider/id_ID/Address.php b/src/Faker/Provider/id_ID/Address.php index 7005836496..258332f640 100644 --- a/src/Faker/Provider/id_ID/Address.php +++ b/src/Faker/Provider/id_ID/Address.php @@ -313,21 +313,4 @@ public static function buildingNumber() { return static::numberBetween(1, 999); } - - /** - * Returns a valid (non-verified) single postal code - * @link http://nomor.net/_kodepos.php?_i=provinsi-kodepos&daerah=&jobs=&perhal=200&urut=&asc=000011111&sby=000000&no1=2 - * @return String Postal Code - */ - // public static function postcode() - // { - // // Ended up using the second result on the first page of google search - // // Because the derelict, decrepit, and non user-friendly - // // Official Government site at: - // // http://kodepos.posindonesia.co.id/kodeposalamatindonesialist.php - // // just won't let you list all currently used postal codes - - // // MAGIC NUMBERS!!! - // return static::numberBetween(10110, 99974); - // } } diff --git a/src/Faker/Provider/id_ID/PhoneNumber.php b/src/Faker/Provider/id_ID/PhoneNumber.php index 96784b8ee1..bd2b23cabf 100644 --- a/src/Faker/Provider/id_ID/PhoneNumber.php +++ b/src/Faker/Provider/id_ID/PhoneNumber.php @@ -5,11 +5,8 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber { protected static $formats = array( - // 8804 234 - '#######', - - // 7777 4444 - '########', + '#######', // 8804 234 + '########', // 7777 4444 ); protected static $internationalPrefixes = array('+62', '(+62)'); @@ -66,14 +63,9 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber ); protected static $mobileNumberFormats = array( - // 0811 XXX XXX, 10 digits, very old - '######', - - // 0811 XXXX XXX, 11 digits - '#######', - - // 0811 XXXX XXXX, 12 digits - '########', + '######', // 0811 XXX XXX, 10 digits, very old + '#######', // 0811 XXXX XXX, 11 digits + '########', // 0811 XXXX XXXX, 12 digits ); public static function internationalNumber() diff --git a/test/Faker/Provider/id_ID/AddressTest.php b/test/Faker/Provider/id_ID/AddressTest.php deleted file mode 100644 index a1c47c4160..0000000000 --- a/test/Faker/Provider/id_ID/AddressTest.php +++ /dev/null @@ -1,37 +0,0 @@ -addProvider(new Address($faker)); - $this->faker = $faker; - } - - public function testPostCodeIsValid() - { - $postcode = ((int)$this->faker->postcode()); - - // This is not meant to test or anything - // But more as a reminder that if someone managed to get a more - // official and factual source of postal code data, they should also - // modify this test, and the corresponding @link - - // MAGIC NUMBERS!!! - // $this->assertTrue($postcode>=10110 && $postcode<=99974); - - $this->assertTrue($postcode>0); - } -} diff --git a/test/Faker/Provider/id_ID/PersonTest.php b/test/Faker/Provider/id_ID/PersonTest.php deleted file mode 100644 index f3d1de3811..0000000000 --- a/test/Faker/Provider/id_ID/PersonTest.php +++ /dev/null @@ -1,36 +0,0 @@ -addProvider(new Person($faker)); - $faker->seed(1); - - $this->assertEquals('Abidah Fifaona', $faker->name); - } - - public function testFirstName() - { - $faker = new Generator(); - $faker->addProvider(new Person($faker)); - $faker->seed(1); - - $this->assertEquals('Abidah', $faker->firstName); - } - - public function testLastName() - { - $faker = new Generator(); - $faker->addProvider(new Person($faker)); - $faker->seed(1); - - $this->assertEquals('Adolf', $faker->lastName); - } -}