CompanyTest.php 628 B

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