This commit is contained in:
2020-10-06 14:27:47 +07:00
commit 586be80cf6
16613 changed files with 3274099 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace Faker\Test\Provider;
use Faker\Provider\UserAgent;
use PHPUnit\Framework\TestCase;
class UserAgentTest extends TestCase
{
public function testRandomUserAgent()
{
$this->assertNotNull(UserAgent::userAgent());
}
public function testFirefoxUserAgent()
{
$this->stringContains(' Firefox/', UserAgent::firefox());
}
public function testSafariUserAgent()
{
$this->stringContains('Safari/', UserAgent::safari());
}
public function testInternetExplorerUserAgent()
{
$this->assertStringStartsWith('Mozilla/5.0 (compatible; MSIE ', UserAgent::internetExplorer());
}
public function testOperaUserAgent()
{
$this->assertStringStartsWith('Opera/', UserAgent::opera());
}
public function testChromeUserAgent()
{
$this->stringContains('(KHTML, like Gecko) Chrome/', UserAgent::chrome());
}
}