菜谱项目

CompanyTest.php 818B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Faker\Test\Provider\kk_KZ;
  3. use Faker\Generator;
  4. use Faker\Provider\kk_KZ\Company;
  5. class CompanyTest extends \PHPUnit_Framework_TestCase
  6. {
  7. /**
  8. * {@inheritdoc}
  9. */
  10. public function setUp()
  11. {
  12. $this->faker = new Generator();
  13. $this->faker->addProvider(new Company($this->faker));
  14. }
  15. public function testBusinessIdentificationNumberIsValid()
  16. {
  17. $registrationDate = new \DateTime('now');
  18. $businessIdentificationNumber = $this->faker->businessIdentificationNumber($registrationDate);
  19. $registrationDateAsString = $registrationDate->format('ym');
  20. $this->assertRegExp(
  21. "/^(" . $registrationDateAsString . ")([4-6]{1})([0-3]{1})(\\d{6})$/",
  22. $businessIdentificationNumber
  23. );
  24. }
  25. }