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,31 @@
<?php
namespace Faker\Test\Provider\kk_KZ;
use Faker\Generator;
use Faker\Provider\kk_KZ\Company;
class CompanyTest extends \PHPUnit_Framework_TestCase
{
/**
* {@inheritdoc}
*/
public function setUp()
{
$this->faker = new Generator();
$this->faker->addProvider(new Company($this->faker));
}
public function testBusinessIdentificationNumberIsValid()
{
$registrationDate = new \DateTime('now');
$businessIdentificationNumber = $this->faker->businessIdentificationNumber($registrationDate);
$registrationDateAsString = $registrationDate->format('ym');
$this->assertRegExp(
"/^(" . $registrationDateAsString . ")([4-6]{1})([0-3]{1})(\\d{6})$/",
$businessIdentificationNumber
);
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Faker\Test\Provider\kk_KZ;
use Faker\Generator;
use Faker\Provider\DateTime;
use Faker\Provider\kk_KZ\Person;
class PersonTest extends \PHPUnit_Framework_TestCase
{
/**
* {@inheritdoc}
*/
public function setUp()
{
$this->faker = new Generator();
$this->faker->addProvider(new Person($this->faker));
}
public function testIndividualIdentificationNumberIsValid()
{
$birthDate = DateTime::dateTimeBetween('-30 years', '-10 years');
$individualIdentificationNumber = $this->faker->individualIdentificationNumber($birthDate);
$controlDigit = Person::checkSum($individualIdentificationNumber);
$this->assertTrue($controlDigit === (int)substr($individualIdentificationNumber, 11, 1));
}
}