]> git.agnieray.net Git - galette.git/blobdiff - tests/GaletteTestCase.php
Instanciate titles, models, status, ...
[galette.git] / tests / GaletteTestCase.php
index 43816ef34a55882f8927cdd506815ca81112588b..cd9818ae66322aa53b9bfe414a7df395e34ca0c7 100644 (file)
@@ -102,6 +102,12 @@ abstract class GaletteTestCase extends TestCase
         $container = $this->container;
         $galette_log_var = $this->logger_storage;
 
+        $this->initPaymentTypes();
+        $this->initStatus();
+        $this->initContributionsTypes();
+        $this->initModels();
+        $this->initTitles();
+
         $authenticate = new \Galette\Middleware\Authenticate($container);
 
         require GALETTE_ROOT . 'includes/routes/main.routes.php';
@@ -713,6 +719,21 @@ abstract class GaletteTestCase extends TestCase
         }
     }
 
+    /**
+     * Initialize default payment types in database
+     *
+     * @return void
+     */
+    protected function initPaymentTypes(): void
+    {
+        $types = new \Galette\Repository\PaymentTypes($this->zdb, $this->preferences, $this->login);
+        if (count($types->getList()) === 0) {
+            //payment types are not yet instanciated.
+            $res = $types->installInit(false);
+            $this->assertTrue($res);
+        }
+    }
+
     /**
      * Initialize default titles in database
      *