菜谱项目

CompanyTest.php 768B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Faker\Test\Provider\nl_NL;
  3. use Faker\Generator;
  4. use Faker\Provider\nl_NL\Company;
  5. class CompanyTest extends \PHPUnit_Framework_TestCase
  6. {
  7. private $faker;
  8. public function setUp()
  9. {
  10. $faker = new Generator();
  11. $faker->addProvider(new Company($faker));
  12. $this->faker = $faker;
  13. }
  14. public function testGenerateValidVatNumber()
  15. {
  16. $vatNo = $this->faker->vat();
  17. $this->assertEquals(14, strlen($vatNo));
  18. $this->assertRegExp('/^NL[0-9]{9}B[0-9]{2}$/', $vatNo);
  19. }
  20. public function testGenerateValidBtwNumberAlias()
  21. {
  22. $btwNo = $this->faker->btw();
  23. $this->assertEquals(14, strlen($btwNo));
  24. $this->assertRegExp('/^NL[0-9]{9}B[0-9]{2}$/', $btwNo);
  25. }
  26. }