add test for AddressReferenceBaseImporter

This commit is contained in:
2022-09-17 10:44:26 +02:00
parent 0f63548d5a
commit 658e846120
2 changed files with 93 additions and 2 deletions

View File

@@ -73,7 +73,7 @@ final class AddressReferenceBaseImporter
public function importAddress(
string $refAddress,
string $refPostalCode,
?string $refPostalCode,
string $postalCode,
string $street,
string $streetNumber,
@@ -157,7 +157,11 @@ final class AddressReferenceBaseImporter
$statement = $this->cachingStatements[$forNumber];
try {
$statement->executeStatement(array_merge(...$this->waitingForInsert));
$affected = $statement->executeStatement(array_merge(...$this->waitingForInsert));
if ($affected === 0) {
throw new \RuntimeException('no row affected');
}
} catch (Exception $e) {
// in some case, we can add debug code here
//dump($this->waitingForInsert);