Skip to content

A free open source IT asset/license management system

Move to a static constructor

Marcus Moore8ac4d3aeea1e
diff --git a/tests/Support/Settings.php b/tests/Support/Settings.php
index bef9378c7b..55ca6edc4f 100644
--- a/tests/Support/Settings.php
+++ b/tests/Support/Settings.php
@@ -8,11 +8,16 @@ class Settings
{
private Setting $setting;
- public function __construct()
+ private function __construct()
{
$this->setting = Setting::factory()->create();
}
+ public static function initialize()
+ {
+ return new self();
+ }
+
public function enableMultipleFullCompanySupport()
{
$this->update(['full_multiple_companies_support' => 1]);
diff --git a/tests/TestCase.php b/tests/TestCase.php
index cc8d36105c..6ab34ba485 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -24,6 +24,6 @@ abstract class TestCase extends BaseTestCase
$this->withoutMiddleware($this->globallyDisabledMiddleware);
- $this->settings = new Settings();
+ $this->settings = Settings::initialize();
}
}