菜谱项目

CompanyTest.php 615B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Faker\Test\Provider;
  3. use Faker\Generator;
  4. use Faker\Provider\Company;
  5. use Faker\Provider\Lorem;
  6. class CompanyTest extends \PHPUnit_Framework_TestCase
  7. {
  8. /**
  9. * @var Generator
  10. */
  11. private $faker;
  12. public function setUp()
  13. {
  14. $faker = new Generator();
  15. $faker->addProvider(new Company($faker));
  16. $faker->addProvider(new Lorem($faker));
  17. $this->faker = $faker;
  18. }
  19. public function testJobTitle()
  20. {
  21. $jobTitle = $this->faker->jobTitle();
  22. $pattern = '/^[A-Za-z]+$/';
  23. $this->assertRegExp($pattern, $jobTitle);
  24. }
  25. }