Skip to content

EspoCRM – Open Source CRM Application

Test set config params method

Yurii2b45fb7382cd
diff --git a/tests/integration/Core/BaseTestCase.php b/tests/integration/Core/BaseTestCase.php
index d861abb986..dddbf11c8a 100644
--- a/tests/integration/Core/BaseTestCase.php
+++ b/tests/integration/Core/BaseTestCase.php
@@ -39,6 +39,7 @@ use Espo\Core\Exceptions\Error;
use Espo\Core\InjectableFactory;
use Espo\Core\Utils\Cache\DataCacheServiceName as CacheServiceName;
use Espo\Core\Utils\Config;
+use Espo\Core\Utils\Config\ConfigWriter;
use Espo\Core\Utils\File\Manager as FileManager;
use Espo\Core\Utils\Metadata;
use Espo\Entities\User;
@@ -380,4 +381,16 @@ abstract class BaseTestCase extends TestCase
$this->transactionManager->start();
}
}
+
+ /**
+ * Set and save config parameters.
+ *
+ * @param array<string, mixed> $params
+ */
+ protected function setConfigParams(array $params): void
+ {
+ $configWriter = $this->getInjectableFactory()->create(ConfigWriter::class);
+ $configWriter->setMultiple($params);
+ $configWriter->save();
+ }
}