定制 matesofmate/phpunit-extension 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

matesofmate/phpunit-extension

Composer 安装命令:

composer require --dev matesofmate/phpunit-extension

包简介

PHPUnit extension for symfony/ai-mate providing token-optimized test execution tools

README 文档

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.8+ required
  • PHPUnit available locally, or a custom command configured

Available Tools

  • phpunit-run
  • phpunit-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

  • default
  • summary
  • detailed

Development

composer install
composer test
composer lint
composer fix

License

MIT

统计信息

  • 总下载量: 5.57k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固