Skip to content

Commit

Permalink
feat(client) removed GZ short code for FireFox family and Create test…
Browse files Browse the repository at this point in the history
… check shortcode comparison to browser
  • Loading branch information
sanchezzzhak authored and sgiehl committed Nov 18, 2024
1 parent ab44b2c commit 4b49df6
Show file tree
Hide file tree
Showing 2 changed files with 22 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
20 changes: 20 additions & 0 deletions Tests/Parser/Client/BrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,26 @@ public function testBrowserFamiliesNoDuplicates(): void
}
}

public function testShortCodesComparisonWithBrowsers(): void
{
$reflectionClass = new \ReflectionClass(Browser::class);
$availableBrowsers = $reflectionClass->getProperty('availableBrowsers')->getValue();
$browserFamilies = $reflectionClass->getProperty('browserFamilies')->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 4b49df6

Please sign in to comment.