[centerHistory] add conditions to be sure at least one center history exists per person

This commit is contained in:
2023-07-27 10:34:19 +02:00
parent f02d97ddb0
commit 2921073da3
2 changed files with 8 additions and 7 deletions

View File

@@ -61,11 +61,11 @@ class PersonMoveTest extends KernelTestCase
$move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher);
$sqls = $move->getSQL($personA, $personB);
$conn = $this->em->getConnection();
// $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) {
$this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) {
foreach ($sqls as $sql) {
$conn->executeStatement($sql);
}
// });
});
$personA = $this->em->find(Person::class, $personA->getId());
$personB = $this->em->find(Person::class, $personB->getId());
@@ -100,11 +100,11 @@ class PersonMoveTest extends KernelTestCase
$move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher);
$sqls = $move->getSQL($personA, $personB);
$conn = $this->em->getConnection();
// $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) {
$this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) {
foreach ($sqls as $sql) {
$conn->executeStatement($sql);
}
// });
});
$personA = $this->em->find(Person::class, $personA->getId());
$personB = $this->em->find(Person::class, $personB->getId());