Files
Toiminnanohjaus/tests/Unit/Modules/Users/Domain/LoginPinTest.php
T
petriandClaude Sonnet 5.5 32c33e2a64 Give the machine console its own session with PIN sign-in, make counters cumulative
The console under console/ has its own session cookie and console guard
(UseConsoleSession), so signing out or changing user there leaves the
normal interface alone. Links open it in a new window through a one-time
handoff key; a signed-out console asks for a PIN code or password on its
own login page. Users set their 4-6 digit PIN on the profile's PIN page,
and the console's change user dialog takes it on a keypad; five wrong
PINs lock PIN sign-in for 15 minutes.

Machine counters are cumulative: users record how much a job used and it
is added to the latest reading. A maintenance record restarts the whole
counter interval from the reading at the record.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-29 09:58:11 +02:00

13 lines
436 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use App\Modules\Users\Domain\Exceptions\InvalidLoginPin;
use App\Modules\Users\Domain\ValueObjects\LoginPin;
it('accepts 4–6 digits as a PIN code', function (string $pin) {
expect((new LoginPin($pin))->value)->toBe(trim($pin));
})->with(['1234', '123456', ' 0042 ']);
it('refuses other PIN codes', function (string $pin) {
new LoginPin($pin);
})->with(['123', '1234567', '12a4', ''])->throws(InvalidLoginPin::class);