This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #395 from bessl/master
Added PhoneNumber for the de_AT Provider and missing test for the 'locale' method.
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Faker\Provider\de_AT; | ||
|
||
class PhoneNumber extends \Faker\Provider\PhoneNumber | ||
{ | ||
protected static $formats = array( | ||
'0650 #######', | ||
'0660 #######', | ||
'0664 #######', | ||
'0676 #######', | ||
'0677 #######', | ||
'0678 #######', | ||
'0699 #######', | ||
'0680 #######', | ||
'+43 #### ####', | ||
'+43 #### ####-##', | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Faker\Test\Provider\de_AT; | ||
|
||
use Faker\Generator; | ||
use Faker\Provider\de_AT\PhoneNumber; | ||
|
||
class PhoneNumberTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
||
/** | ||
* @var Generator | ||
*/ | ||
private $faker; | ||
|
||
public function setUp() | ||
{ | ||
$faker = new Generator(); | ||
$faker->addProvider(new PhoneNumber($faker)); | ||
$this->faker = $faker; | ||
} | ||
|
||
public function testPhoneNumberFormat() | ||
{ | ||
$number = $this->faker->phoneNumber; | ||
$this->assertRegExp('/^06\d{2} \d{7}|\+43 \d{4} \d{4}(-\d{2})?$/', $number); | ||
} | ||
} |