From 3167ee91d17e11b86fcad450319bc806e25b06f2 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 16 Aug 2024 10:51:49 +0100 Subject: [PATCH] Added a setting test and validation on settings Signed-off-by: snipe --- app/Models/Setting.php | 3 +++ tests/Feature/Settings/AlertsSettingTest.php | 23 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/Feature/Settings/AlertsSettingTest.php diff --git a/app/Models/Setting.php b/app/Models/Setting.php index 1a25735e0d..d775be81c5 100755 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -74,7 +74,10 @@ class Setting extends Model 'login_remote_user_header_name' => 'string|nullable', 'thumbnail_max_h' => 'numeric|max:500|min:25', 'pwd_secure_min' => 'numeric|required|min:8', + 'alert_threshold' => 'numeric|nullable', + 'alert_interval' => 'numeric|nullable', 'audit_warning_days' => 'numeric|nullable', + 'due_checkin_days' => 'numeric|nullable', 'audit_interval' => 'numeric|nullable', 'custom_forgot_pass_url' => 'url|nullable', 'privacy_policy_link' => 'nullable|url', diff --git a/tests/Feature/Settings/AlertsSettingTest.php b/tests/Feature/Settings/AlertsSettingTest.php new file mode 100644 index 0000000000..87e7c0286a --- /dev/null +++ b/tests/Feature/Settings/AlertsSettingTest.php @@ -0,0 +1,23 @@ +create(); + $this->actingAs(User::factory()->create()) + ->get(route('settings.alerts.index')) + ->assertForbidden(); + } + +}