raneomik/infection-tester-adapter

Tester Adapter for Infection

Installs: 61

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:infection-extension

pkg:composer/raneomik/infection-tester-adapter

v0.2.3 2026-02-24 02:36 UTC

This package is auto-updated.

Last update: 2026-02-24 19:13:15 UTC


README

Coding Standards Mutation Testing Tests Coverage Status Mutation testing badge

Disclaimer: AI agent experiment - chat-gpt5.2 & claude sonnet 4.5 wrote ~60-75% of this project, by my lack of knowledge on this topic and lack of time to learn... I thought it would be interesting to ask AI "Hey, I discovered this framework, and it comes with its own testing framework. But I love Infection and its metrics to push you to test your tests, and could be cool to add an adapter to it... Are we in ? - yes, Here's your code" (it wasn't this simple, here's some copilot's very verbose journals & reports for french speakers - it's a real mess, sorry, all dev problems seem to be included) and share the result.

The remaining ~20% was based on PhpSpec Adapter and Codeception Adapter. Big shoutout to Maks Rafalko & Infection community for this amazing tool

This package provides test framework adapter of Tester for infection.

Architecture

Installation

composer require --dev [infection/infection] raneomik/infection-tester-adapter

The adapter should be automatically registered in Infection's runtime through its auto-discovery mechanism.

Usage

Once installed, you can run Infection:

vendor/bin/infection # optional: --test-framework=tester

Configuration

This adapter works directly with your existing Tester tests, with some limitations:

  • Tester provides jUnit.xml and Clover.xml coverage reports, but Infection expects a more complete phpunit-like report. This adapter embeds transformation of Testers' reports & generation during the mutation process, so it is NOT recomended to use --skip-initial-tests with --coverage options (it just results in xpath read/FQCN error, unless you are using a script which does the needed trasformation).
  • Test cases are recommended for a better report result. But seem slower.
  • other forms of tests are supported, but need namespaces to be identified by Infection and referenced in report as covering code.
  • conflict with files may occur using --debug option and result in mutation coverge gen errors. Removing '<configured tmp dir|/tmp>/infection' should fix it.

No additional configuration needed, "Convention over configuration" principle. ("have tests in 'tests/' dir and bootstrap.php file in your tests root" is the main requirement)

Infection configuration file infection.json5.dist.

For more information on configuring Infection, see the Infection documentation.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.