菜谱项目

InternetTest.php 740B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Faker\Test\Provider\it_CH;
  3. use Faker\Generator;
  4. use Faker\Provider\it_CH\Person;
  5. use Faker\Provider\it_CH\Internet;
  6. use Faker\Provider\it_CH\Company;
  7. class InternetTest extends \PHPUnit_Framework_TestCase
  8. {
  9. /**
  10. * @var Faker\Generator
  11. */
  12. private $faker;
  13. public function setUp()
  14. {
  15. $faker = new Generator();
  16. $faker->addProvider(new Person($faker));
  17. $faker->addProvider(new Internet($faker));
  18. $faker->addProvider(new Company($faker));
  19. $this->faker = $faker;
  20. }
  21. /**
  22. * @test
  23. */
  24. public function emailIsValid()
  25. {
  26. $email = $this->faker->email();
  27. $this->assertNotFalse(filter_var($email, FILTER_VALIDATE_EMAIL));
  28. }
  29. }