- Guide
- Playground
- GitHub
-
Ecosystem
Help
Resource Lists
Recent Posts
- What's new in Infection 0.26.0
- What's new in Infection 0.25.0
- What's new in Infection 0.24.0
- What's new in Infection 0.23.0
- What's new in Infection 0.21.0
- What's new in Infection 0.20.0
- What's new in Infection 0.19.0
- What's new in Infection 0.18.0
- What's new in Infection 0.17.0
- What's new in Infection 0.16.0
What's new in Infection 0.8.0
Feb 28, 2018
Release: https://github.com/infection/infection/releases/tag/0.8.0
BC Breaks
Before upgrading, make sure you know about backward incompatible changes.
exclude
setting has been removed from the config fileinfection.json
. Instead, please useexcludes
. This was done to make Infection’s config file compatible with Humbug’s one.All paths from the config file are now relative to the config file instead of to the current working directory.
New features and enhancements
Pass existing coverage
In Infection 0.8.0, we have implemented a feature that allows providing existing Coverage Reports from PHPUnit
and/or PhpSpec
to Infection.
Why is it needed?
When you use Continuous Integration for your project, probably you are already generating code coverage metrics and run PHPUnit with XDebug
/phpdbg
enabled. Then, you run Infection for mutation testing, which in its turn, generates Code Coverage again for internal needs. This dramatically increases the build time because running your tests with debugger twice requires too much time.
Now it’s possible to reuse already generated coverage in Infection. Assuming you have PHPUnit, just do it as following:
# collect XML and JUnit coverage |
Moreover, Infection does not require XDebug
/phpdbg
enabled if coverage is provided. It means, before running Infection you can disable debugger at all.
Pass PHP options to Initial Tests run process
Not all people have Xdebug
enabled permanently. You may like running scripts by php -d zend_extension=xdebug.so script.php
command in order to debug it.
Before, it was not possible to run Infection in such a way. Since Infection needs debugger just for Initial Tests Run step to generate code coverage, we’ve added a new option where you can pass additional parameters to PHP executable for this process - --initial-tests-php-options
.
Assuming Xdebug is disabled, you can run it as:
infection.phar --initial-tests-php-options="-d zend_extension=xdebug.so" |
New Mutators
Two new mutators have been added:
Throw Mutator
- throw new \FileNotFoundException('...'); |
You can run only this mutation operator to see how good your MSI is for exceptions testing:
infection.phar --mutators=Throw_ |
Integer Decrement and Increment Mutators
$users = [new User('Ivan', 17), new User('Ann', 23)]; |
Other updates
Besides that, we’ve improved mutation testing for Traits, improved Public/Protected Visibility mutators a little bit: they don’t mutate abstract methods anymore.
There was some work to improve Infection Performance. Now, all generated mutants are reused, which reduces filesystem operations.
If you didn’t try Infection with your CI process, now it’s the best time.
Thanks everyone involved!