From 8ac4d3aeea1e778fb5a8f7206ee9bf27df79f399 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 6 Apr 2023 17:42:15 -0700 Subject: [PATCH] Move to a static constructor --- tests/Support/Settings.php | 7 ++++++- tests/TestCase.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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(); } }