Skip to content

Add PHPUnit 12 support and fix test compatibility issues #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2025

Conversation

tkaratug
Copy link
Contributor

@tkaratug tkaratug commented Jul 1, 2025

Summary

This PR adds support for PHPUnit 12 and fixes test compatibility issues that arose from updates to the underlying php-mcp/server package.

Changes Made

1. PHPUnit Version Support

  • Updated composer.json to support PHPUnit 12 alongside existing versions 10 and 11
  • Changed constraint from ^10.0 || ^11.0 to ^10.0 || ^11.0 || ^12.0

2. Test Fixes

  • Fixed failing tests in ManualRegistrationTest.php that were caused by API changes in php-mcp/server v3.2.1
  • Updated test assertions to use the new handler property instead of deprecated handlerClass and handlerMethod properties
  • The registered elements now store handler information in a single handler property that can contain:
    • Array format: [ClassName::class, 'methodName'] for class methods
    • String format: ClassName::class for invokable classes

Testing

  • All 26 tests now pass successfully
  • No breaking changes to existing functionality
  • Maintains backward compatibility

Motivation

This update ensures the package works with the latest PHPUnit version and remains compatible with recent updates to the php-mcp/server dependency.

tkaratug added 2 commits July 1, 2025 15:33
- Changed assertions in ManualRegistrationTest to verify handler as an array containing the handler class and method instead of separate properties.
- Updated tests to reflect the new structure for handler registration, ensuring consistency across tool, resource, and prompt registrations.
@CodeWithKyrian
Copy link
Contributor

Thank you!

@CodeWithKyrian CodeWithKyrian merged commit 6f9ce34 into php-mcp:main Jul 1, 2025
4 checks passed
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.

2 participants