mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-01 04:49:36 +00:00
Refactored LCSCBarcocdeScanResult to be an value object like the other Barcode results
This commit is contained in:
parent
76584c3d99
commit
338c5ebf0b
7 changed files with 74 additions and 47 deletions
|
|
@ -170,8 +170,8 @@ final class BarcodeScanHelperTest extends WebTestCase
|
|||
$result = $this->service->scanBarcodeContent($input);
|
||||
|
||||
$this->assertInstanceOf(LCSCBarcodeScanResult::class, $result);
|
||||
$this->assertSame('C138033', $result->getPC());
|
||||
$this->assertSame('RC0402FR-071ML', $result->getPM());
|
||||
$this->assertSame('C138033', $result->lcscCode);
|
||||
$this->assertSame('RC0402FR-071ML', $result->mpn);
|
||||
}
|
||||
|
||||
public function testLcscExplicitTypeParses(): void
|
||||
|
|
@ -181,8 +181,8 @@ final class BarcodeScanHelperTest extends WebTestCase
|
|||
$result = $this->service->scanBarcodeContent($input, BarcodeSourceType::LCSC);
|
||||
|
||||
$this->assertInstanceOf(LCSCBarcodeScanResult::class, $result);
|
||||
$this->assertSame('C138033', $result->getPC());
|
||||
$this->assertSame('RC0402FR-071ML', $result->getPM());
|
||||
$this->assertSame('C138033', $result->lcscCode);
|
||||
$this->assertSame('RC0402FR-071ML', $result->mpn);
|
||||
}
|
||||
|
||||
public function testLcscExplicitTypeRejectsNonLcsc(): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue