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

Italian Vat id and Tax id support #790

Merged
merged 4 commits into from
Feb 9, 2016
Merged

Italian Vat id and Tax id support #790

merged 4 commits into from
Feb 9, 2016

Conversation

brainrepo
Copy link
Contributor

Italian TaxId (Codice fiscale) https://it.wikipedia.org/wiki/Codice_fiscale
Italian VatId (Partita iva) https://it.wikipedia.org/wiki/Partita_iva

public function testIfTaxIdCanReturnData()
{
$vatId = $this->faker->vatId();
$this->assertRegExp('/^IT{12}[0-9]$/', $vatId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know exactly how the regexify method works, but doesn't this match only ITTTTTTTTTTTT[0-9]?
Sorry if I'm missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops it is a mistake i fix it now!
Tnks

@brainrepo
Copy link
Contributor Author

I fixed the mistake

*/
public static function vatId()
{
return static::regexify('/^IT[0-9]{12}$/');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting from https://en.wikipedia.org/wiki/VAT_identification_number :

11 digits (the first 7 digits is a progressive number, the following 3 means the province of residence, the last digit is a check number)

*/
public static function vatId()
{
return static::regexify('/^IT[0-9]{11}$/');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regexify is very slow, use numerify instead.

@fzaninotto
Copy link
Owner

You should add a mention of the new providers in the Readme, under the "Locales" section.

@brainrepo
Copy link
Contributor Author

Travis fail in HHVM build

There was 1 failure:
1) Faker\Test\Provider\InternetTest::testIpv4NotLocalNetwork
Failed asserting that '1.156.0.249' does not match PCRE pattern "/\A1\./".
/home/travis/build/fzaninotto/Faker/test/Faker/Provider/InternetTest.php:113

fzaninotto added a commit that referenced this pull request Feb 9, 2016
Italian Vat id and Tax id support
@fzaninotto fzaninotto merged commit ff1d463 into fzaninotto:master Feb 9, 2016
@fzaninotto
Copy link
Owner

Thanks!

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.

3 participants