matesofmate / phpunit-extension
PHPUnit extension for symfony/ai-mate providing token-optimized test execution tools
Package info
github.com/MatesOfMate/phpunit-extension
Type:symfony-ai-mate
pkg:composer/matesofmate/phpunit-extension
Requires
- php: >=8.2
- matesofmate/common: ^0.2@dev
- symfony/ai-mate: ^0.7
- symfony/finder: ^5.4|^6.4|^7.3|^8.0
- symfony/process: ^5.4|^6.4|^7.3|^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^10.0
- rector/rector: ^2.0
Suggests
- helgesverre/toon: Install for TOON-encoded MCP responses; JSON remains the fallback when it is not available
This package is auto-updated.
Last update: 2026-04-16 19:38:18 UTC
README
Token-efficient PHPUnit tools for AI assistants. This package runs tests and returns encoded structured responses designed for debugging and iteration.
Features
- run the full suite, a file, a class, or a single method through one tool
- list discoverable tests
- encoded output with three consistent detail modes
- custom command support for containerized setups
Installation
composer require --dev matesofmate/phpunit-extension vendor/bin/mate init
In current AI Mate setups, extension discovery is handled automatically after Composer install and update. Run vendor/bin/mate discover when you want to refresh discovery artifacts such as mate/AGENT_INSTRUCTIONS.md.
Useful Mate commands:
vendor/bin/mate debug:extensions vendor/bin/mate debug:capabilities vendor/bin/mate mcp:tools:list --extension=matesofmate/phpunit-extension
Use the generated wrapper for Codex:
./bin/codex
Custom Command Configuration
If PHPUnit must run through Docker or another wrapper command, configure matesofmate_phpunit.custom_command.
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return static function (ContainerConfigurator $container): void { $container->parameters()->set('matesofmate_phpunit.custom_command', [ 'docker', 'compose', 'exec', 'php-test', 'vendor/bin/phpunit', ]); };
Requirements
- PHP 8.2+
- Symfony AI Mate 0.7+ required
- PHPUnit available locally, or a custom command configured
Available Tools
phpunit-runphpunit-list-tests
All tools return encoded strings through Mate's core ResponseEncoder. Install the suggested helgesverre/toon package if you want TOON responses; otherwise the same payload falls back to JSON.
Output Modes
defaultsummarydetailed
Development
composer install
composer test
composer lint
composer fix
License
MIT