Include Vendor

This commit is contained in:
Mathieu Lagace
2018-06-27 20:31:54 -04:00
parent d0807a7cf5
commit 5fa3c85b97
6624 changed files with 728653 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace Faker\Test\Provider\pt_BR;
use Faker\Generator;
use Faker\Provider\pt_BR\Company;
class CompanyTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
$faker = new Generator();
$faker->addProvider(new Company($faker));
$this->faker = $faker;
}
public function testCnpjFormatIsValid()
{
$cnpj = $this->faker->cnpj(false);
$this->assertRegExp('/\d{8}\d{4}\d{2}/', $cnpj);
$cnpj = $this->faker->cnpj(true);
$this->assertRegExp('/\d{2}\.\d{3}\.\d{3}\/\d{4}-\d{2}/', $cnpj);
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Faker\Test\Provider\pt_BR;
use Faker\Generator;
use Faker\Provider\pt_BR\Person;
class PersonTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
$faker = new Generator();
$faker->addProvider(new Person($faker));
$this->faker = $faker;
}
public function testCpfFormatIsValid()
{
$cpf = $this->faker->cpf(false);
$this->assertRegExp('/\d{9}\d{2}/', $cpf);
$cpf = $this->faker->cpf(true);
$this->assertRegExp('/\d{3}\.\d{3}\.\d{3}-\d{2}/', $cpf);
}
public function testRgFormatIsValid()
{
$rg = $this->faker->rg(false);
$this->assertRegExp('/\d{8}\d/', $rg);
$rg = $this->faker->rg(true);
$this->assertRegExp('/\d{2}\.\d{3}\.\d{3}-[0-9X]/', $rg);
}
}