Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

UserAgentTest.php 908B

1234567891011121314151617181920212223242526272829303132333435363738
  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. }