- 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.10.0
Aug 11, 2018
Release: https://github.com/infection/infection/releases/tag/0.10.0
BC Breaks
Before upgrading, make sure you know about backward incompatible changes.
- Infection now requires PHP 7.1+. If you can’t for some reason upgrade and stuck on 7.0, don’t worry, you can still use 0.9.0.
- PHAR file is no longer signed with OpenSSL built-in algorithm. See below.
New features and enhancements
Phive
Infection now can be installed by Phive - The PHAR Installation and Verification Environment. Since Phive requires GPG signing, we dropped built-in PHP OpenSSL signing. For each release we will upload infection.phar
and infection.phar.asc
. Previously downloaded infection.phar.pubkey
can be deleted.
With Phive you can install Infection as
phive install infection |
You can still download the PHAR file manually, the process is almost the same:
wget https://github.com/infection/infection/releases/download/0.10.0/infection.phar |
Verify integrity:
gpg --recv-keys C6D76C329EBADE2FB9C458CFC5095986493B4AA0 |
You should see something like:
gpg: Signature made Sun Aug 5 21:46:42 2018 +03 |
Homebrew
There was a reorganization of taps in Homebrew PHP and not all previously existed packages have been moved to the Homebrew core, including Infection.
We created our custom repository so you can continue using brew
to install Infection:
brew tap infection/homebrew-infection |
Thanks Pierre du Plessis for helping and maintaining it!
Time and memory
Infection now outputs information about how much time and memory did it take to run mutation testing:
[...] |
Sorting the log file
When you have hundreds or even thousands of mutations, and especially when you use --threads
, it’s quite difficult to read log file because each time mutations were logged in a random order (due to parallel processes).
Now mutations are sorted by file path and then by line of the mutation:
3) Domain/Model/Goal/Goal.php:82 [M] MethodCallRemoval |
New Mutators
FunctionCallRemoval
and MethodCallRemoval
These two mutators will remove function or method calls that are not part of another statement (e.g. if
/loop
), or get assigned to a value.
This should help make sure that your tests are covering side effects caused by an action.
- ksort($this->calculatorPerMutator); |
or
- $this->eventDispatcher->dispatch(new InitialTestSuiteStarted()); |
PregMatchMatches
Helps to check you are correctly testing the logic of preg_match()
calls:
- preg_match('/a/', 'abc', $foo); |
Coalesce
This mutator removes condition part of Coalesce
operator ($a ?? $b
-> $b
):
private function getListeners(string $eventName): array |
Enjoy!