Skip to content

Commit

Permalink
Merge branch 'master' into os
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezzzhak authored Nov 19, 2024
2 parents c24bdfd + f3c7b29 commit f0514db
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -774,11 +774,11 @@ class Browser extends AbstractClientParser
],
'Firefox' => [
'FF', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
'FB', 'FE', 'AX', 'FM', 'FR', 'FY', 'GZ', 'I4', 'IF',
'FB', 'FE', 'AX', 'FM', 'FR', 'FY', 'I4', 'IF', '8P',
'IW', 'LH', 'LY', 'MB', 'MN', 'MO', 'MY', 'OA', 'OS',
'PI', 'PX', 'QA', 'S5', 'SX', 'TF', 'TO', 'WF', 'ZV',
'FP', 'AD', '2I', 'P9', 'KJ', 'WY', 'VK', 'W5',
'7C', 'N7', 'W7', '8P',
'7C', 'N7', 'W7',
],
'Internet Explorer' => ['IE', 'CZ', 'BZ', 'IM', 'PS', '3A', '4A', 'RN'],
'Konqueror' => ['KO'],
Expand Down
25 changes: 25 additions & 0 deletions Tests/Parser/Client/BrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,31 @@ public function testBrowserFamiliesNoDuplicates(): void
}
}

public function testShortCodesComparisonWithBrowsers(): void
{
$reflectionClass = new \ReflectionClass(Browser::class);
$browserProperty = $reflectionClass->getProperty('availableBrowsers');
$browserProperty->setAccessible(true);
$availableBrowsers = $browserProperty->getValue();

$browserFamilyProperty = $reflectionClass->getProperty('browserFamilies');
$browserFamilyProperty->setAccessible(true);
$browserFamilies = $browserFamilyProperty->getValue();
$result = [];

foreach ($browserFamilies as $codes) {
foreach ($codes as $code) {
if (isset($availableBrowsers[$code])) {
continue;
}

$result[] = $code;
}
}

$this->assertEquals([], $result, 'These shortcode does not match the list of browsers');
}

/**
* @return array
*/
Expand Down

0 comments on commit f0514db

Please sign in to comment.