From 860e076b89bf052f4b6a26bad155268b2d361a53 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 13 Jul 2023 16:18:39 +0200 Subject: [PATCH] [test] add dataprovider for testing move person where both are participating in the same parcours --- .../PersonMoveCenterHistoryHandler.php | 45 ------------------- .../Tests/Action/Remove/PersonMoveTest.php | 19 ++++++++ 2 files changed, 19 insertions(+), 45 deletions(-) delete mode 100644 src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php deleted file mode 100644 index 25767d175..000000000 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ /dev/null @@ -1,45 +0,0 @@ -getId(), $from->getId(), $to->getId()); - - $updateSql = sprintf(<<getId()); - } - -} diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index 88869bf7d..1a49783c8 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -5,6 +5,8 @@ namespace Action\Remove; use Chill\ActivityBundle\Entity\Activity; use Chill\PersonBundle\Actions\Remove\PersonMove; use Chill\PersonBundle\Actions\Remove\PersonMoveManager; +use Chill\PersonBundle\Entity\AccompanyingPeriod; +use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; use Chill\PersonBundle\Entity\Household\Household; use Chill\PersonBundle\Entity\Household\HouseholdMember; use Chill\PersonBundle\Entity\Person; @@ -132,6 +134,23 @@ class PersonMoveTest extends KernelTestCase yield [$personA, $personB, "move 2 people having the same household at the same time"]; + $personA = new Person(); + $personB = new Person(); + $parcours = new AccompanyingPeriod(); + + $parcours->addPerson($personA); + $parcours->addPerson($personB); + + $this->em->persist($personA); + $this->em->persist($personB); + $this->em->persist($parcours); + + self::$entitiesToDelete[] = [Person::class, $personA]; + self::$entitiesToDelete[] = [Person::class, $personB]; + self::$entitiesToDelete[] = [AccompanyingPeriod::class, $parcours]; + + yield [$personA, $personB, "move 2 people participating to the same parcours"]; + $this->em->flush(); $this->em->clear(); }