Skip to content

A free open source IT asset/license management system

Merge branch 'develop' into refactor/store_asset_form_request

Spencer Long854640708352
diff --cc tests/Support/Settings.php
index 288a3ec8a8,30fe8c7017..daeac032eb
--- a/tests/Support/Settings.php
+++ b/tests/Support/Settings.php
@@@ -64,28 -65,42 +65,61 @@@ class Setting
'next_auto_tag_base' => '123',
'zerofill_count' => 5
]);
+ }
+
+ public function disableAutoIncrement(): Settings
+ {
+ return $this->update([
+ 'auto_increment_assets' => 0,
+ 'auto_increment_prefix' => '',
+ 'next_auto_tag_base' => '',
+ 'zerofill_count' => 0
+ ]);
+ }
+ public function enableUniqueSerialNumbers(): Settings
+ {
+ return $this->update(['unique_serial' => 1]);
+ }
+
+ public function disableUniqueSerialNumbers(): Settings
+ {
+ return $this->update(['unique_serial' => 0]);
}
+ public function enableLdap(): Settings
+ {
+ return $this->update([
+ 'ldap_enabled' => 1,
+ 'ldap_server' => 'ldaps://ldap.example.com',
+ 'ldap_uname' => 'fake_username',
+ 'ldap_pword' => Crypt::encrypt("fake_password"),
+ 'ldap_basedn' => 'CN=Users,DC=ad,DC=example,Dc=com'
+ ]);
+ }
+
+ public function enableAnonymousLdap(): Settings
+ {
+ return $this->update([
+ 'ldap_enabled' => 1,
+ 'ldap_server' => 'ldaps://ldap.example.com',
+ // 'ldap_uname' => 'fake_username',
+ 'ldap_pword' => Crypt::encrypt("fake_password"),
+ 'ldap_basedn' => 'CN=Users,DC=ad,DC=example,Dc=com'
+ ]);
+ }
+
+ public function enableBadPasswordLdap(): Settings
+ {
+ return $this->update([
+ 'ldap_enabled' => 1,
+ 'ldap_server' => 'ldaps://ldap.example.com',
+ 'ldap_uname' => 'fake_username',
+ 'ldap_pword' => "badly_encrypted_password!",
+ 'ldap_basedn' => 'CN=Users,DC=ad,DC=example,Dc=com'
+ ]);
+ }
+
/**
* @param array $attributes Attributes to modify in the application's settings.
*/