This commit is contained in:
Saeed Vaziry
2025-06-04 19:04:02 +02:00
parent 35894003f5
commit f8f8d57fe2
31 changed files with 165 additions and 171 deletions

View File

@ -7,7 +7,10 @@
class AgentTest extends TestCase
{
private $operatingSystems = [
/**
* @var array<string, string>
*/
private array $operatingSystems = [
'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko' => 'Windows',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2' => 'OS X',
'Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko ) Version/5.1 Mobile/9B176 Safari/7534.48.3' => 'iOS',
@ -18,7 +21,10 @@ class AgentTest extends TestCase
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36' => 'Windows',
];
private $browsers = [
/**
* @var array<string, string>
*/
private array $browsers = [
'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko' => 'IE',
'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25' => 'Safari',
'Mozilla/5.0 (Windows; U; Win 9x 4.90; SG; rv:1.9.2.4) Gecko/20101104 Netscape/9.1.0285' => 'Netscape',
@ -36,7 +42,10 @@ class AgentTest extends TestCase
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/86.0.180 Chrome/80.0.3987.180 Safari/537.36' => 'Coc Coc',
];
private $mobileDevices = [
/**
* @var array<string>
*/
private array $mobileDevices = [
'Mozilla/5.0 (iPhone; U; ru; CPU iPhone OS 4_2_1 like Mac OS X; ru) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148a Safari/6533.18.5',
'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25',
'Mozilla/5.0 (Linux; U; Android 2.3.4; fr-fr; HTC Desire Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
@ -45,7 +54,10 @@ class AgentTest extends TestCase
'Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; ASUS Transformer Pad TF300T Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30',
];
private $desktops = [
/**
* @var array<string>
*/
private array $desktops = [
'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko',
'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0',
'Mozilla/5.0 (Windows; U; Win 9x 4.90; SG; rv:1.9.2.4) Gecko/20101104 Netscape/9.1.0285',
@ -56,7 +68,7 @@ class AgentTest extends TestCase
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2',
];
public function test_operating_systems()
public function test_operating_systems(): void
{
$agent = new Agent;
@ -66,7 +78,7 @@ public function test_operating_systems()
}
}
public function test_browsers()
public function test_browsers(): void
{
$agent = new Agent;
@ -76,7 +88,7 @@ public function test_browsers()
}
}
public function test_desktop_devices()
public function test_desktop_devices(): void
{
$agent = new Agent;
@ -86,7 +98,7 @@ public function test_desktop_devices()
}
}
public function test_mobile_devices()
public function test_mobile_devices(): void
{
$agent = new Agent;