]> git.agnieray.net Git - galette.git/commitdiff
Delete child first to clean tests
authorJohan Cwiklinski <johan@x-tnd.be>
Sun, 10 Oct 2021 12:39:01 +0000 (14:39 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 17 Oct 2021 04:15:40 +0000 (06:15 +0200)
tests/Galette/Entity/tests/units/Adherent.php

index b93353446b9f448f99139b469b2c8f7cae1972bf..034db9e0d2ac39d8eb10fde10462d073fa531f7f 100644 (file)
@@ -64,6 +64,12 @@ class Adherent extends GaletteTestCase
     public function tearDown()
     {
         $this->zdb = new \Galette\Core\Db();
+
+        $delete = $this->zdb->delete(\Galette\Entity\Adherent::TABLE);
+        $delete->where(['fingerprint' => 'FAKER' . $this->seed]);
+        $delete->where('parent_id IS NOT NULL');
+        $this->zdb->execute($delete);
+
         $delete = $this->zdb->delete(\Galette\Entity\Adherent::TABLE);
         $delete->where(['fingerprint' => 'FAKER' . $this->seed]);
         $this->zdb->execute($delete);