mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-04-21 16:01:56 +02:00
Enhancement: Assert that postcode generated by Austrian Address provider matches format
This commit is contained in:
parent
e06b547f62
commit
c9f691175a
35
test/Faker/Provider/de_AT/AddressTest.php
Normal file
35
test/Faker/Provider/de_AT/AddressTest.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Test\Provider\de_AT;
|
||||
|
||||
|
||||
use Faker\Generator;
|
||||
use Faker\Provider\de_AT\Address;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class AddressTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var Generator
|
||||
*/
|
||||
private $faker;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$faker = new Generator();
|
||||
|
||||
$faker->addProvider(new Address($faker));
|
||||
|
||||
$this->faker = $faker;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://en.wikipedia.org/wiki/List_of_postal_codes_in_Austria
|
||||
*/
|
||||
public function testPostcodeReturnsPostcodeThatMatchesAustrianFormat()
|
||||
{
|
||||
$postcode = $this->faker->postcode;
|
||||
|
||||
$this->assertRegExp('/^[1-9]\d{3}$/', $postcode);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user