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

Add a building number with letter to German speaking locales. #903

Merged

Conversation

markuspoerschke
Copy link
Contributor

In Austria, Germany, and Switzerland a building number can have a letter as a suffix. Example: Hauptstraße 23a.

@fzaninotto
Copy link
Owner

Tests fail

@markuspoerschke
Copy link
Contributor Author

The test is based on fortuity. Changing the test to the following solved the problem:

public function testMobilePhoneNumberStartWith9Returns9yxxxxxx()
    {
        $mobileNumber = $this->faker->mobileNumber();
        $mobileNumber = $this->faker->mobileNumber();
        $mobileNumber = $this->faker->mobileNumber();
        $mobileNumber = $this->faker->mobileNumber();
        $mobileNumber = $this->faker->mobileNumber();
        $mobileNumber = $this->faker->mobileNumber();
        $startsWith9 = false;
        while (!$startsWith9) {
            $mobileNumber = $this->faker->mobileNumber();
            $startsWith9 = preg_match('/^(\+65|65)?\s*9/', $mobileNumber);
        }

        $this->assertRegExp('/^(\+65|65)?\s*9\s*[0-8]{3}\s*\d{4}$/', $mobileNumber);
    }

I fixed the test by resetting the seed.

@fzaninotto fzaninotto merged commit 191fc2b into fzaninotto:master May 10, 2016
@fzaninotto
Copy link
Owner

Thanks!

@markuspoerschke
Copy link
Contributor Author

:-) Thanks for merging!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants