Refactored LCSCBarcocdeScanResult to be an value object like the other Barcode results

This commit is contained in:
Jan Böhmer 2026-02-21 23:26:25 +01:00
parent 76584c3d99
commit 338c5ebf0b
7 changed files with 74 additions and 47 deletions

View file

@ -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