Skip to content

[3.0] Gives the existing tests the license header and the agreed docblocks - #9756

Merged
live627 merged 2 commits into
SimpleMachines:release-3.0from
albertlast:3.0/tests-follow-conventions
Oct 8, 2026
Merged

live627 merged 2 commits into
SimpleMachines:release-3.0from
albertlast:3.0/tests-follow-conventions

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

The follow-up promised in #9754: the existing tests now follow the conventions AGENTS.md describes. It touches comments only. No test code or assertion changes.

1. License header (f5766871b, 74 files). Every PHP file under tests/ other than the index.php stubs opens with the same header as Sources/. It is copied byte for byte from Sources/Sapi.php. check-smf-license.php skips ./tests/, so nothing checked this before.

2. Test method docblocks (6a3bf799d, 57 files, about 280 methods). Every test method has the docblock from Test method docblocks:

  • a one-sentence summary;
  • Expected: with the call and the result its assertions check;
  • for a regression test, Guards: with what went wrong, plus @link lines to the commit that introduced the bug and to the issue or pull request that fixed it.

A comment at the top of a test body that explained why the test exists has moved into the docblock. Every other comment in the bodies is untouched.

36 regression tests carry an Introduced by link. The line is left out where the faulty code is already in the 2012 import, or where the introducing commit could not be confirmed from its diff, as AGENTS.md asks. A missing line can be added later, but a wrong one would mislead.

ThemeCopyTest is not included, because #9728 rewrites it and already gives its tests docblocks in this shape.

How it was checked
  • Code unchanged: for each of the 57 changed files, the code with comments and whitespace stripped (php -w) is identical before and after.
  • Coverage: every public function test*() in tests/ has a docblock with Expected:, apart from the three in ThemeCopyTest.
  • Links: each of the 36 Introduced by links names an existing commit, and its quoted subject matches git log -1 --format=%s exactly.
  • Attributions: the ones that were less certain were traced by hand against the commit's diff. Examples:
    • Url::proxied() → 1c9e53bf7: it first passed the bracketed host to filter_var().
    • the cache tests → 8b7ef30ce: it added strict_types and the typed signatures.
    • TimeTest → 7bc3a536c: it began reading User::$me directly.
    • ReplyNotificationTest → 147061675: the frequency values were already 0 none, 1 every reply, 2 first unread.
  • php-cs-fixer, as CI runs it: Found 0 of 57 files that can be fixed.
  • Unit and AutoReview suites: 422 tests, 3146 assertions, 6 skipped (the cache accelerators the container lacks), the same as release-3.0. The integration files pass php -l. Since only comments changed, the integration and HTTP suites were not rerun.

The docblocks were drafted by several agents working through the files in parallel from one written brief. Everything above was then checked over the whole set. The Introduced by links are the part most worth a reviewer's glance.

Conflicts to expect

The header commit touches files that open pull requests also change: GuestPagesTest (#9739), HttpTestCase (#9712, #9727), and ThemeCopyListTest (#9728). The conflicts are small, and whichever lands second needs a rebase.

Issues References (Fixes|Related|Closes)

Related: #9754

🤖 Generated with Claude Code

albertlast and others added 2 commits October 5, 2026 06:13
Every PHP file under tests/ other than the index.php stubs now opens with
the same license header as Sources/, as AGENTS.md asks. The header is
copied byte for byte from Sources/Sapi.php. check-smf-license.php skips
./tests/, so nothing checked this before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Each test method now has the docblock AGENTS.md describes: a summary,
Expected: with the call and the result its assertions check, and for a
regression test, Guards: with what went wrong, a @link to the commit that
introduced the bug and a @link to the issue or pull request that fixed it.

The Introduced by line is left out where the faulty code is older than
the history (it is already in the 2012 import) or where the commit could
not be confirmed from its diff. A comment at the top of a test body that
explained why the test exists has moved into the docblock; nothing else
in the bodies has changed.

ThemeCopyTest is left alone, because SimpleMachines#9728 rewrites it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@live627
live627 merged commit 4af5bd8 into SimpleMachines:release-3.0 Oct 8, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants