Skip to content

Move definition handler tests to the end-to-end tier - #684

Draft
Firehed wants to merge 13 commits into
e2e-variable-definitionsfrom
e2e-definition-handler
Draft

Firehed wants to merge 13 commits into
e2e-variable-definitionsfrom
e2e-definition-handler

Conversation

@Firehed

@Firehed Firehed commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Stacked on #683.

Moves DefinitionHandlerIntegrationTest onto the end-to-end tier.

Scripts

  • One script per fixture-driven case, opening the same files the original test opened. Each expects the file and line the original asserted, or NoAnswer() where it asserted none. The attribute-class case was already covered by definition-open-documents.
  • Cases that used inline source now use fixtures:
    • an unknown class and a class from new reuse existing markers;
    • built-in classes get a new fixture, EdgeCases/BuiltinDefinitions.php. Built-ins have no file to go to on any PHP version, so these answers are stable.
  • Two inline cases are dropped: go-to-definition on the self keyword in self::class outside a class, and at line 0, column 0. No marker can place those cursors, and neither covered anything unique.

Malformed parameters

MessageErrorTest sends four malformed definition requests and checks that each is answered and the session carries on. Today the answer is a null result; JSON-RPC 2.0 §5.1 also defines InvalidParams for this. The handler's own parameter checks are covered by DefinitionHandlerTest.

Unit tests

VariableResolutionTest (from #683) is renamed ExpressionResolutionTest, since it now covers more than variables. It gains the resolution paths only the original reached: a variable assigned by a ternary, and a static property or constant on a variable class.

Coverage: unchanged, file by file.

🤖 Generated with Claude Code

Firehed and others added 10 commits October 3, 2026 16:02
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.67%. Comparing base (73c1be2) to head (13f5457).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                     Coverage Diff                     @@
##             e2e-variable-definitions     #684   +/-   ##
===========================================================
  Coverage                       99.67%   99.67%           
  Complexity                       1900     1900           
===========================================================
  Files                             135      135           
  Lines                            4873     4873           
===========================================================
  Hits                             4857     4857           
  Misses                             16       16           

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

@Firehed
Firehed added this pull request to stack #688 October 4, 2026 01:49
Firehed and others added 3 commits October 3, 2026 20:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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