Commit graph

38 commits

Author SHA1 Message Date
cebed26cde
require user arg in bulk node test helper 2026-05-02 22:22:21 +03:00
db93871194
move inline use statements to file headers
two type hints introduced earlier on this branch referenced
classes by their fully-qualified names inline. hoist them to
the top-of-file use block per backend-context.md PHP rules.
2026-05-02 22:05:58 +03:00
e56cb56ce7
test node controller ownership checks
add failing tests asserting 403 when a non-owner tries to
read or write nodes on another user's text, plus admin
bypass. existing tests now attach a session user to mirror
the new controller signature.
2026-05-02 21:45:15 +03:00
ea6d65a77d
test text controller scoping and ownership
add failing tests for getMyTexts (own-only), getAllTexts
(admin), getText 403 for non-owner, and admin bypass on
getText. existing test_get_one_text updated to pass the
session user via the new request signature.
2026-05-02 21:41:52 +03:00
cbbbc80326
update downstream tests for text user requirement
Text now requires a User on construction. seed a user in
each test setUp that creates a Text directly or through the
fake repository so the suite remains green.
2026-05-02 21:27:55 +03:00
40fdf25da2
add tests for text user relationship
cover that the created Text carries the supplied User, that
the controller persists the user from the session attribute,
and that any userId in the request body is ignored.
2026-05-02 21:27:49 +03:00
ed4440eec2
test scheduled node controller returns 404 when user missing 2026-05-01 10:25:24 +03:00
659f9b88f1
test scheduled node controller surfaces date error from use case 2026-05-01 10:24:43 +03:00
c9f1379496
remove default values from test helpers 2026-05-01 10:05:07 +03:00
636d2dc517
test get scheduled nodes endpoint 2026-05-01 09:58:28 +03:00
a9265abeae
add node to scheduled node 2026-04-27 09:28:43 +03:00
8eb0f2366b
remove missed default value 2026-04-26 20:43:27 +03:00
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
05374991c5
update plan controller tests for auth 2026-04-24 13:31:44 +03:00
edfe7259a3
test auth controller 2026-04-24 13:27:49 +03:00
73ade7f971
update tests for user password hash 2026-04-24 13:19:51 +03:00
9d831915de
test create plan schedules nodes 2026-04-24 11:02:55 +03:00
0ff5043ba5
test create plan persists plan 2026-04-24 11:02:38 +03:00
165f08f04d
test create plan 404 when text not found 2026-04-24 11:02:20 +03:00
2238202384
test create plan 404 when user not found 2026-04-24 11:02:00 +03:00
68554cb362
test create plan 400 when date end before start 2026-04-24 11:01:47 +03:00
2a76f69553
test create plan 400 when date end missing 2026-04-24 11:01:34 +03:00
21bed284e9
test create plan 400 when date start missing 2026-04-24 11:01:21 +03:00
0b4f7c61ef
test create plan 400 when name missing 2026-04-24 11:01:06 +03:00
088fa5b533
test create plan 400 when text id missing 2026-04-24 11:00:53 +03:00
ecb43fda2d
test create plan 400 when user id missing 2026-04-24 11:00:37 +03:00
ef71708abe
test create plan returns 201 2026-04-24 11:00:23 +03:00
6b310c8c9c
add plan controller test scaffold 2026-04-24 11:00:06 +03:00
82dab3b90f
test create text controller returns 400 when name missing 2026-04-19 23:38:02 +03:00
189493b045
php cs fixer 2026-04-19 23:07:48 +03:00
612564e9fb
test controller 2026-04-18 23:04:25 +03:00
56bdee86cc
fix controller tests to pass in data in proper form 2026-04-18 21:59:57 +03:00
1c1f8b5a58
add tests for node controller
get nodes of text and create node
2026-04-18 21:27:36 +03:00
38d06fce43
refactor getNodes into a new NodeController and update refs 2026-04-17 11:29:55 +03:00
9b24fddec1
update text controller test with node repo 2026-04-17 11:01:20 +03:00
98f597914a
test text controller methods 2026-04-17 09:55:29 +03:00