Commit d6526ff
committed
fix(tests): replace checkbox assertions with DoesNotPerformAssertions (middleware)
Replace `addToAssertionCount(1)` placeholders in AppFramework middleware
tests that only verify no exception is thrown.
For `SameSiteCookieMiddlewareTest`, two tests already have
`expects(self::once())` mock expectations as their real assertion — those
just have the redundant placeholder removed. The third test has no
expectations and gets `#[DoesNotPerformAssertions]`.
For `SecurityMiddlewareTest`, `testIsSubAdminCheck` and
`testIsSubAdminAndAdminCheck` get `#[DoesNotPerformAssertions]`.
`testRestrictedAppLoggedInPublicPage` and `testRestrictedAppNotLoggedInPublicPage`
have `->with()` argument constraints that count as assertions in PHPUnit 11,
so the redundant placeholder is simply removed.
Part of a broader effort to eliminate checkbox tests (see also #60742, #60747).
Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 492a42b commit d6526ff
2 files changed
Lines changed: 3 additions & 7 deletions
File tree
- tests/lib/AppFramework/Middleware/Security
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | | - | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | | - | |
88 | 86 | | |
89 | 87 | | |
90 | 88 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
477 | 478 | | |
478 | | - | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| 482 | + | |
482 | 483 | | |
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
486 | 487 | | |
487 | | - | |
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
510 | 509 | | |
511 | 510 | | |
512 | 511 | | |
| |||
523 | 522 | | |
524 | 523 | | |
525 | 524 | | |
526 | | - | |
527 | 525 | | |
528 | 526 | | |
529 | 527 | | |
| |||
0 commit comments