Commit graph

4 commits

Author SHA1 Message Date
cd40483cd4
remove default values from user constructors
Forcing every call site to be explicit about admin status and
password eliminates a class of bugs where an unintended
isAdmin=false or empty passwordHash could silently slip through.
The CreateUserTest case that asserted the isAdmin default is
dropped since the default no longer exists.
2026-04-26 10:46:07 +03:00
13da7c311a
return utc from clock 2026-04-26 10:32:08 +03:00
bb6bd7cbb3
use FakePasswordHasher in tests to eliminate bcrypt cost
Add a trivial prefix-based PasswordHasher fake and inject it into the
three test files that exercise CreateUser or AuthenticateUser. Drops
the full phpunit suite from ~7.4s to ~30ms (about 224x) without
losing coverage: the round-trip through hash/verify still validates
that CreateUser stores something other than the plaintext and that
AuthenticateUser only succeeds on a matching hash.

CreateUserTest is also refactored to use a setUp method, matching
the pattern already used in AuthenticateUserTest and AuthControllerTest.
2026-04-26 09:06:26 +03:00
edfe7259a3
test auth controller 2026-04-24 13:27:49 +03:00