Skip to content

Commit 8502df0

Browse files
committed
Added test for autodetection of EIGP114 barcodes
1 parent bf2a776 commit 8502df0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/Services/LabelSystem/BarcodeScanner/BarcodeScanHelperTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343

4444
use App\Entity\LabelSystem\LabelSupportedElement;
4545
use App\Services\LabelSystem\BarcodeScanner\BarcodeScanHelper;
46+
use App\Services\LabelSystem\BarcodeScanner\BarcodeScanResultInterface;
4647
use App\Services\LabelSystem\BarcodeScanner\BarcodeSourceType;
48+
use App\Services\LabelSystem\BarcodeScanner\EIGP114BarcodeScanResult;
4749
use App\Services\LabelSystem\BarcodeScanner\LocalBarcodeScanResult;
4850
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
4951

@@ -110,6 +112,17 @@ public static function dataProvider(): \Iterator
110112
//Test vendor barcode
111113
yield [new LocalBarcodeScanResult(LabelSupportedElement::PART_LOT, 2,BarcodeSourceType::USER_DEFINED),
112114
'lot2_vendor_barcode'];
115+
116+
$eigp114Result = new EIGP114BarcodeScanResult([
117+
'P' => '596-777A1-ND',
118+
'1P' => 'XAF4444',
119+
'Q' => '3',
120+
'10D' => '1452',
121+
'1T' => 'BF1103',
122+
'4L' => 'US',
123+
]);
124+
125+
yield [$eigp114Result, "[)>\x1E06\x1DP596-777A1-ND\x1D1PXAF4444\x1DQ3\x1D10D1452\x1D1TBF1103\x1D4LUS\x1E\x04"];
113126
}
114127

115128
public static function invalidDataProvider(): \Iterator
@@ -130,7 +143,7 @@ public static function invalidDataProvider(): \Iterator
130143
/**
131144
* @dataProvider dataProvider
132145
*/
133-
public function testNormalizeBarcodeContent(LocalBarcodeScanResult $expected, string $input): void
146+
public function testNormalizeBarcodeContent(BarcodeScanResultInterface $expected, string $input): void
134147
{
135148
$this->assertEquals($expected, $this->service->scanBarcodeContent($input));
136149
}

0 commit comments

Comments
 (0)