Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Enhancement: Assert that postcode generated by Austrian Address provider matches format #1766

Merged
merged 1 commit into from
Aug 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions test/Faker/Provider/de_AT/AddressTest.php
Original file line number Diff line number Diff line change
@@ -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);
}
}