- Guide
- Playground
- GitHub
-
Ecosystem
Help
Resource Lists
Documentation
- Introduction
- Installation
- Usage
- Command Line Options
- Mutators
- Custom Mutators
- Profiles
- Using with CI
- Mutation Badge, cloud HTML report
- How-to Guides
- Caveats
- Debugging Issues
- Infection Playground
- GitHub Sponsors ♥️
- Supported Test Frameworks
Miscellaneous
- Compare with competitors
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
Profiles
Infection supports the use of mutator profiles for the command line and configuration file.
The following configuration file will use the @default
profile, but turn off the @function_signature
profile.
On top of that, it does not apply the TrueValue
mutator on any classes that match the provided ignore patterns. In particular, TrueValue
mutator does not mutate the code inside Full\NameSpaced\Class
class and inside create()
method of all SourceClass
classes. Finally, the MethodCallRemoval
mutator will ignore line 63 of AnotherClass
in the method doSomething
. Specifying the line gives the ability to ignore one instance in a method, but still process other instances in the same method.
global-ignore
allows to apply the ignore
setting to all mutators & profiles registered. If ignore
is specified for a given profile or mutator, it will be merged with global-ignore
. For example, in the case below the final ignore
setting for TrueValue
will be:
[ |
global-ignoreSourceCodeByRegex
allows to apply the ignoreSourceCodeByRegex
setting to all mutators & profiles registered and works similar to global-ignore
setting.
Read more about
ignore
andignoreSourceCodeByRegex
settings
These ignores can also be added to profiles, to ensure Infection is as flexible as you need it.
All profiles are prepended by an @
and in snake case, while all mutators are in PascalCase.
{ |
The Profiles
Currently, infection supports the following profiles:
@arithmetic
Contains the following mutators:
- Assignment
- AssignmentEqual
- BitwiseAnd
- BitwiseNot
- BitwiseOr
- BitwiseXor
- Decrement
- DivEqual
- Division
- Exponentiation
- Increment
- Minus
- MinusEqual
- ModEqual
- Modulus
- MulEqual
- Multiplication
- Plus
- PlusEqual
- PowEqual
- ShiftLeft
- ShiftRight
- RoundingFamily
@boolean
Contains the following mutators:
- ArrayItem
- FalseValue
- IdenticalEqual
- LogicalAnd
- LogicalLowerAnd
- LogicalLowerOr
- LogicalNot
- LogicalOr
- NotIdenticalNotEqual
- TrueValue
- Yield_
@cast
Contains the following mutators:
@conditional_boundary
Contains the following mutators:
@conditional_negotiation
Contains the following mutators:
- Equal
- GreaterThanNegotiation
- GreaterThanOrEqualToNegotiation
- Identical
- LessThanNegotiation
- LessThanOrEqualToNegotiation
- NotEqual
- NotIdentical
@equal
Contains the following mutators:
@function_signature
Contains the following mutators:
@identical
Contains the following mutators:
@number
Contains the following mutators:
@operator
Contains the following mutators:
- AssignCoalesce
- Break_
- Coalesce
- Continue_
- Finally_
- SpreadAssignment
- SpreadOneItem
- SpreadRemoval
- Throw_
@regex
Contains the following mutators:
@removal
Contains the following mutators:
@return_value
Contains the following mutators:
@sort
Contains the following mutators:
@unwrap
Contains the following mutators:
- UnwrapArrayChangeKeyCase
- UnwrapArrayChunk
- UnwrapArrayColumn
- UnwrapArrayCombine
- UnwrapArrayDiff
- UnwrapArrayDiffAssoc
- UnwrapArrayDiffKey
- UnwrapArrayDiffUassoc
- UnwrapArrayDiffUkey
- UnwrapArrayFilter
- UnwrapArrayFlip
- UnwrapArrayIntersect
- UnwrapArrayIntersectAssoc
- UnwrapArrayIntersectKey
- UnwrapArrayIntersectUassoc
- UnwrapArrayIntersectUkey
- UnwrapArrayKeys
- UnwrapArrayMap
- UnwrapArrayMerge
- UnwrapArrayMergeRecursive
- UnwrapArrayPad
- UnwrapArrayReduce
- UnwrapArrayReplace
- UnwrapArrayReplaceRecursive
- UnwrapArrayReverse
- UnwrapArraySlice
- UnwrapArraySplice
- UnwrapArrayUdiff
- UnwrapArrayUdiffAssoc
- UnwrapArrayUdiffUassoc
- UnwrapArrayUintersect
- UnwrapArrayUintersectAssoc
- UnwrapArrayUintersectUassoc
- UnwrapArrayUnique
- UnwrapArrayValues
- UnwrapLcFirst
- UnwrapLtrim
- UnwrapRtrim
- UnwrapStrIreplace
- UnwrapStrRepeat
- UnwrapStrReplace
- UnwrapStrRev
- UnwrapStrShuffle
- UnwrapSubstr
- UnwrapStrToLower
- UnwrapStrToUpper
- UnwrapTrim
- UnwrapUcFirst
- UnwrapUcWords
@zero_iteration
Contains the following mutators:
@extensions
Contains the following mutators:
@default
This is the default profile, which currently contains most mutators, and is used if no mutator or profile is chosen.
Feel free to request a new profile to be added in Github’s issues.