Skip to content

Commit

Permalink
Removed duplicate key ATVIO brand (#6965)
Browse files Browse the repository at this point in the history
* fix: removed duplicate ATVIO brand
* feat(test) added test testDuplicateBrands
  • Loading branch information
sanchezzzhak authored Jan 13, 2022
1 parent 6b2b7ea commit 0ef6636
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion Parser/Device/AbstractDeviceParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ abstract class AbstractDeviceParser extends AbstractParser
'ZA' => 'Avenzo',
'AH' => 'AVH',
'AV' => 'Avvio',
'Y6' => 'ATVIO',
'AY' => 'Axxion',
'XA' => 'Axioo',
'AM' => 'Azumi Mobile',
Expand Down
15 changes: 15 additions & 0 deletions Tests/DeviceDetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,21 @@ public function testCheckRegexRestrictionEndCondition(): void
$this->assertTrue($this->checkRegexRestrictionEndCondition('TestValue(?:[;)/]|$)'), 'pass condition');
}

/**
* Checks the AbstractDeviceParser::$deviceBrands for duplicate brands
*/
public function testDuplicateBrands(): void
{
$brands = \array_map('strtolower', AbstractDeviceParser::$deviceBrands);
$unique = \array_unique($brands);
$duplicates = \array_diff_assoc($brands, $unique);

$this->assertCount(0, $duplicates, \sprintf(
'Duplicate brands exists: %s',
\print_r($duplicates, true)
));
}

/**
* check the Symfony parser for fixtures parsing errors
*/
Expand Down

0 comments on commit 0ef6636

Please sign in to comment.