diff --git a/src/Faker/Provider/de_AT/Address.php b/src/Faker/Provider/de_AT/Address.php index 1d7803cecf..861f6fcdda 100644 --- a/src/Faker/Provider/de_AT/Address.php +++ b/src/Faker/Provider/de_AT/Address.php @@ -4,7 +4,7 @@ class Address extends \Faker\Provider\Address { - protected static $buildingNumber = array('###', '##', '#'); + protected static $buildingNumber = array('###', '##', '#', '##[abc]', '#[abc]'); protected static $streetSuffixLong = array( 'Gasse', 'Platz', 'Ring', 'Straße', 'Weg', @@ -108,4 +108,9 @@ public static function state() { return static::randomElement(static::$state); } + + public static function buildingNumber() + { + return static::regexify(self::numerify(static::randomElement(static::$buildingNumber))); + } } diff --git a/src/Faker/Provider/de_CH/Address.php b/src/Faker/Provider/de_CH/Address.php index c892819672..8d9a258b00 100644 --- a/src/Faker/Provider/de_CH/Address.php +++ b/src/Faker/Provider/de_CH/Address.php @@ -4,7 +4,7 @@ class Address extends \Faker\Provider\Address { - protected static $buildingNumber = array('###', '##', '#', '#a', '#b', '#c'); + protected static $buildingNumber = array('###', '##', '#', '##[abc]', '#[abc]'); protected static $streetSuffixLong = array( 'Gasse', 'Platz', 'Ring', 'Strasse', 'Weg', 'Allee' @@ -177,4 +177,9 @@ public static function cantonName() $canton = static::canton(); return current($canton); } + + public static function buildingNumber() + { + return static::regexify(self::numerify(static::randomElement(static::$buildingNumber))); + } } diff --git a/src/Faker/Provider/de_DE/Address.php b/src/Faker/Provider/de_DE/Address.php index 586402a729..05b1a6e5b6 100644 --- a/src/Faker/Provider/de_DE/Address.php +++ b/src/Faker/Provider/de_DE/Address.php @@ -4,7 +4,7 @@ class Address extends \Faker\Provider\Address { - protected static $buildingNumber = array('###', '##', '#', '#/#'); + protected static $buildingNumber = array('###', '##', '#', '#/#', '##[abc]', '#[abc]'); protected static $streetSuffixLong = array( 'Gasse', 'Platz', 'Ring', 'Straße', 'Weg', 'Allee' @@ -87,4 +87,9 @@ public static function state() { return static::randomElement(static::$state); } + + public static function buildingNumber() + { + return static::regexify(self::numerify(static::randomElement(static::$buildingNumber))); + } } diff --git a/test/Faker/Provider/en_SG/PhoneNumberTest.php b/test/Faker/Provider/en_SG/PhoneNumberTest.php index 60828b21cc..9b72d14a70 100644 --- a/test/Faker/Provider/en_SG/PhoneNumberTest.php +++ b/test/Faker/Provider/en_SG/PhoneNumberTest.php @@ -7,11 +7,13 @@ class PhoneNumberTest extends \PHPUnit_Framework_TestCase { + private $faker; + public function setUp() { - $faker = Factory::create('en_SG'); - $faker->addProvider(new PhoneNumber($faker)); - $this->faker = $faker; + $this->faker = Factory::create('en_SG'); + $this->faker->seed(1); + $this->faker->addProvider(new PhoneNumber($this->faker)); } // http://en.wikipedia.org/wiki/Telephone_numbers_in_Singapore#Numbering_plan