菜谱项目

InternetTest.php 717B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Faker\Test\Provider\ng_NG;
  3. use Faker\Generator;
  4. use Faker\Provider\en_NG\Person;
  5. use Faker\Provider\en_NG\Internet;
  6. class InternetTest 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 Person($faker));
  16. $faker->addProvider(new Internet($faker));
  17. $this->faker = $faker;
  18. }
  19. public function testEmailIsValid()
  20. {
  21. $email = $this->faker->email();
  22. $this->assertNotFalse(filter_var($email, FILTER_VALIDATE_EMAIL));
  23. $this->assertNotEmpty($email);
  24. $this->assertInternalType('string', $email);
  25. }
  26. }