Skip to content

Move handler tests that build the full stack to tests/Integration - #660

Merged
Firehed merged 4 commits into
mainfrom
phase-1-handler-integration-renames
Sep 30, 2026
Merged

Firehed merged 4 commits into
mainfrom
phase-1-handler-integration-renames

Conversation

@Firehed

@Firehed Firehed commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Phase 1 of a two-part change. Pure git mv and class rename for the four *HandlerTest.php files whose setUp builds the full production symbol-knowledge stack — they were already integration tests wearing a unit-test filename (their #[CoversClass] lists already name ExpressionResolver, ResolvedTypeOnly, and much of the completion pipeline).

Phase 2 will add stub/mock-based unit tests for the same four handlers, plus a phpunit.xml.dist split into unit / integration suites.

What changed

  • git mv tests/Handler/{SignatureHelp,Definition,Hover,Completion}HandlerTest.php → tests/Integration/{SignatureHelp,Definition,Hover,Completion}HandlerIntegrationTest.php
  • Namespace and class name adjusted; OpensDocumentsTrait pulled in explicitly now that the moved files no longer share its namespace.

No behavior change; the same tests run and pass.

🤖 Generated with Claude Code

Firehed and others added 4 commits September 30, 2026 16:03
Its setUp builds the full production symbol-knowledge stack over fixtures
and its CoversClass list already names ExpressionResolver and
ResolvedTypeOnly. The filename now matches what the test is.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Its setUp builds the full production symbol-knowledge stack over fixtures
and its CoversClass list already names ExpressionResolver and
ResolvedTypeOnly. The filename now matches what the test is.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Its setUp builds the full production symbol-knowledge stack over fixtures
and its CoversClass list already names ExpressionResolver and
ResolvedTypeOnly. The filename now matches what the test is.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Its setUp builds the full production symbol-knowledge stack and its
CoversClass list names most of the completion pipeline (BuiltinTypeCandidates,
CompositeCompletionSource, ExpressionResolver, KeywordCandidates,
MemberCandidates, NamedArgumentCandidates, ResolvedTypeOnly, SymbolCandidates,
VariableCandidates). The filename now matches what the test is.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.65%. Comparing base (b5f69e1) to head (f7e80a1).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #660   +/-   ##
=========================================
  Coverage     99.65%   99.65%           
  Complexity     1903     1903           
=========================================
  Files           136      136           
  Lines          4882     4882           
=========================================
  Hits           4865     4865           
  Misses           17       17           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Firehed
Firehed merged commit 2f60faf into main Sep 30, 2026
9 checks passed
@Firehed
Firehed deleted the phase-1-handler-integration-renames branch September 30, 2026 23:15
Firehed added a commit that referenced this pull request Oct 1, 2026
…suite split (#661)

Follows #660. Adds real unit tests for the four handlers whose test
files were moved to `tests/Integration/`, now that the `*HandlerTest`
filenames are available again.

## What changed

- New `BuildsHandlerRequestsTrait` and `StubsCollaboratorsTrait` under
`tests/Handler/` carry the shared helpers.
- New `SignatureHelpHandlerTest`, `DefinitionHandlerTest`,
`HoverHandlerTest`, `CompletionHandlerTest` under `tests/Handler/`. Each
stubs its handler's interface collaborators and asserts only on the
handler's own behavior: method claim, short-circuits on malformed params
/ unopened documents / unresolved cursors, and the exact wire shape
emitted for a resolved result.
- `phpunit.xml.dist` now defines two disjoint testsuites: `unit`
(everything outside `tests/Integration`) and `integration`
(`tests/Integration` only). Running phpunit without `--testsuite` runs
both.
- Removes the integration tests that only duplicated the above (method
claim, the three short-circuits, markup kind grid).

## Why

Every production handler already takes its collaborators through
interfaces, so writing real unit tests for them needs no change under
`src/`. The prior fixture-driven suites rebuilt
`KnowledgeStack::forProject`'s output in setUp — a duplicate wiring
route the design rules flag. Shrinking the surface that reaches for
`BuildsKnowledgeStackTrait` is a prerequisite for later replacing
`Server::forProject` / `KnowledgeStack::forProject` with container
factories.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant