mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-05 03:27:33 +09:00
* Harden URL, mail, and locale handling * Keep Sentry hardening mail test offline with unsupported DSN scheme * Move Sentry regression tests into their module test files * Drop Sentry issue IDs from regression test names * Drop Sentry issue ID from Twig cache failure test name * Drop Sentry issue IDs from test comments
24 lines
752 B
PHP
24 lines
752 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
test('getPasswordLength returns the default when not configured', function (): void {
|
|
$manager = new Server_Manager_Custom([]);
|
|
|
|
expect($manager->getPasswordLength())->toBe(10);
|
|
});
|
|
|
|
test('getPasswordLength returns an int when configured with an int', function (): void {
|
|
$manager = new Server_Manager_Custom(['passwordLength' => 16]);
|
|
|
|
expect($manager->getPasswordLength())->toBe(16);
|
|
});
|
|
|
|
test('getPasswordLength coerces a numeric string to int', function (): void {
|
|
// A numeric string stored in the server configuration must not violate
|
|
// the `int` return type.
|
|
$manager = new Server_Manager_Custom(['passwordLength' => '12']);
|
|
|
|
expect($manager->getPasswordLength())->toBe(12);
|
|
});
|