菜谱项目

PaymentTest.php 628B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Faker\Test\Provider\bg_BG;
  3. use Faker\Generator;
  4. use Faker\Provider\bg_BG\Payment;
  5. class PaymentTest extends \PHPUnit_Framework_TestCase
  6. {
  7. /**
  8. * @var Generator
  9. */
  10. private $faker;
  11. public function setUp()
  12. {
  13. $faker = new Generator();
  14. $faker->addProvider(new Payment($faker));
  15. $this->faker = $faker;
  16. }
  17. public function testVatIsValid()
  18. {
  19. $vat = $this->faker->vat();
  20. $unspacedVat = $this->faker->vat(false);
  21. $this->assertRegExp('/^(BG \d{9,10})$/', $vat);
  22. $this->assertRegExp('/^(BG\d{9,10})$/', $unspacedVat);
  23. }
  24. }