You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
908B

  1. <?php
  2. namespace Faker\Test\Provider;
  3. use Faker\Provider\UserAgent;
  4. class UserAgentTest extends \PHPUnit_Framework_TestCase
  5. {
  6. public function testRandomUserAgent()
  7. {
  8. $this->assertNotNull(UserAgent::userAgent());
  9. }
  10. public function testFirefoxUserAgent()
  11. {
  12. $this->stringContains(' Firefox/', UserAgent::firefox());
  13. }
  14. public function testSafariUserAgent()
  15. {
  16. $this->stringContains('Safari/', UserAgent::safari());
  17. }
  18. public function testInternetExplorerUserAgent()
  19. {
  20. $this->assertStringStartsWith('Mozilla/5.0 (compatible; MSIE ', UserAgent::internetExplorer());
  21. }
  22. public function testOperaUserAgent()
  23. {
  24. $this->assertStringStartsWith('Opera/', UserAgent::opera());
  25. }
  26. public function testChromeUserAgent()
  27. {
  28. $this->stringContains('(KHTML, like Gecko) Chrome/', UserAgent::chrome());
  29. }
  30. }