Commit 1b7789c
committed
fix: address Critical/Important findings + phpunit-test-naming audit from code review
- Restored tests/Feature/Clients/ClientAuthorizationTest.php and
ClientPerformanceTest.php, deleted during the Feature/Unit
consolidation with no replacement anywhere - lost the only test
gating client-delete-by-permission and 6 N+1-query regression
tests. Also fixed their non-it_-prefixed method names
(userWithoutClientCreatePermission... -> it_...) and added missing
: void return types while restoring.
- AbstractTestCase::setUp() silently skipped user creation/auth setup
if the `users` table didn't exist after its (SQLite-workaround)
migrate:fresh-skip logic, rather than failing loud. Now throws a
clear RuntimeException explaining what to check, instead of letting
downstream tests fail confusingly on a null $this->user. Also
updated the stale SQLite-specific comment now that SQLite is
eliminated from this suite - the skip-when-RefreshDatabase-is-used
behavior itself is still correct (avoids a redundant/conflicting
second migration), just the old comment's specific justification no
longer applied.
- Restored it_posting_to_appointments_resource_route_returns_not_found
into AppointmentsTest.php - the one test with real regression value
(asserts POST /appointments still 404s/405s) that got dropped when
AppointmentsStoreRemovedTest.php was deleted. Left the two dropped
method_exists() reflection checks out, per review.
- CommentControllerTest had zero negative-authorization coverage.
Investigated: StoreCommentRequest::authorize() only checks
auth()->check() on both develop and this branch (unchanged - not a
regression), and no COMMENT_* permission exists anywhere in this
app, consistent with its permission-based (not per-resource-
ownership) authorization model elsewhere. Added tests documenting
that actual behavior (any authenticated user can comment on any
task) plus the unauthenticated-request 401/403 case, rather than
inventing new authorization logic that isn't part of this app's
existing model.
- Fixed : void return type on the 5 test methods added earlier this
session (LeadsTest.php x3, OffersTest.php x2).
Fixing two pre-existing tests broken by Bottelet#459's Handler::render()
change (AuthorizationException now redirects+flashes for non-JSON
requests instead of returning a raw 403): ClientAuthorizationTest's
storeClient permission-denial test and UsersTest's
it_only_owner_role_can_update_user both asserted the old 403 status;
updated to assert the new (intentionally improved) redirect+flash
behavior. Also fixed my own new CommentControllerTest assertion that
didn't account for CommentService's clean() wrapping plain text in
<p> tags.
Verified: full suite (950 tests, 2334 assertions) passes against
real MySQL.1 parent 185f03e commit 1b7789c
8 files changed
Lines changed: 556 additions & 20 deletions
File tree
- tests
- Feature
- Clients
- Controllers
- Leads
- Offers
- Users
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | | - | |
50 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | | - | |
53 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
54 | 62 | | |
55 | 63 | | |
56 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
0 commit comments