菜谱项目

PersonTest.php 525B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Faker\Test\Provider\es_PE;
  3. use Faker\Generator;
  4. use Faker\Provider\es_PE\Person;
  5. class PersonTest extends \PHPUnit_Framework_TestCase
  6. {
  7. /**
  8. * @var Generator
  9. */
  10. private $faker;
  11. public function setUp()
  12. {
  13. $faker = new Generator();
  14. $faker->seed(1);
  15. $faker->addProvider(new Person($faker));
  16. $this->faker = $faker;
  17. }
  18. public function testDNI()
  19. {
  20. $dni = $this->faker->dni;
  21. $this->assertRegExp('/\A[0-9]{8}\Z/', $dni);
  22. }
  23. }