Infection

Author(s)
Maks Rafalko
Website
https://infection.github.io/
License
BSD 3-Clause License
Documentation
https://infection.github.io/guide/index.html
GitHub
infection/infection
Packagist
infection/infection
DockerHub
phpqa/infection
Dependencies
xdebug/phpdbg

0 0 0

Infection is a PHP mutation testing framework based on AST (Abstract Syntax Tree) mutations.

Infection runs your test suit, mutates the source code with a set of predefined mutators (mutation operators) and collects the results of killed, escaped mutants and timeouts.

After running Infection, you will receive a Mutation Score Indicator and your Mutation Code Coverage.

Installation

Install from a Composer package as a dev dependency (with Composer)

Check if all dependencies are installed: xdebug/phpdbg.

Make sure you have Composer installed.

Require it as a dev dependency:
composer require --dev infection/infection
Run it:
php vendor/bin/infection

Install from a Composer package as a global CLI utility (with Composer)

Check if all dependencies are installed: xdebug/phpdbg.

Make sure you have Composer installed.

Require it as a global CLI utility:
composer global require infection/infection
Run it:
infection
Make sure your global vendor binaries directory is in your $PATH environment variable. Check the Composer documentation for more information.

Install from a PHP Archive (with curl or wget)

Check if all dependencies are installed: xdebug/phpdbg.

The PHPUnit documentation has a clear manual on how to install PHARs on Windows.

If you have the Suhosin extension enabled, make sure to allow the execution of PHARs in your php.ini:
suhosin.executor.include.whitelist = phar

Locally
Download it:
wget -O infection.phar https://github.com/infection/infection/releases/download/X.X.X/infection.phar
or
curl -sSL https://github.com/infection/infection/releases/download/X.X.X/infection.phar -o infection.phar
Use it:
php infection.phar
Globally
Download it:
wget -O infection.phar https://github.com/infection/infection/releases/download/X.X.X/infection.phar
or
curl -sSL https://github.com/infection/infection/releases/download/X.X.X/infection.phar -o infection.phar
Install it as an executable:
chmod a+x infection.phar
sudo mv infection.phar /usr/local/bin/infection
Use it:
infection