php-sdk/tests/Unit
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mateu Aguiló Bosch ab4f686e18
refactor: put formatters into dedicated classes (#224)
Split formatting logic from Reference classes into dedicated formatter classes:
- ToolResultFormatter: Formats tool execution results into Content items
- PromptResultFormatter: Formats prompt results into PromptMessage items
- ResourceResultFormatter: Formats resource results into ResourceContents items

This refactor:
- Eliminates 122 lines of code duplication between ResourceReference and
  ResourceTemplateReference (identical formatting logic)
- Improves code organization by separating formatting concerns from
  capability reference management
- Makes formatters independently testable and reusable
- Reduces Reference classes by ~450 lines while maintaining all functionality

Changes:
- Create src/Capability/Formatter/* with three formatter classes
- Update Reference classes to delegate to formatters instead of inline logic
- Add comprehensive test coverage for all formatter classes
- All existing tests pass; no behavioral changes
2026-01-18 22:17:44 +01:00
..
Capability refactor: put formatters into dedicated classes (#224) 2026-01-18 22:17:44 +01:00
Fixtures/Enum Split testsuite for unit and inspector based tests (#82) 2025-09-25 22:27:41 +01:00
JsonRpc [Server] Add Bidirectional Client Communication Support (#109) 2025-10-26 22:48:17 +01:00
Schema Add support for icons and website url (#141) 2025-11-09 14:53:36 +01:00
Server Use SchemaValidator to validate tool input (#203) 2026-01-11 21:46:53 +01:00
ServerTest.php [Server] Refactor protocol pipeline to separate request and notification handling (#106) 2025-10-12 13:53:41 +01:00