Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for TrueValue mutator setting #105

Merged
merged 1 commit into from Jan 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 23 additions & 3 deletions src/guide/mutators.md
Expand Up @@ -104,12 +104,10 @@ The Round Family mutator will make sure that there's enough tests to cover the r

### Boolean Substitution

This temporarily encompasses logical mutators.

| Name | Original | Mutated |
| :------: | :------: |:-------:|
| ArrayItem | `[$a->foo => $b->bar]` | `[$a->foo > $b->bar]` |
| TrueValue | true | false |
| [TrueValue](/guide/mutators.html#TrueValue) | true | false |
| FalseValue | false | true |
| LogicalAnd | && | || |
| LogicalOr | || | && |
Expand All @@ -119,6 +117,28 @@ This temporarily encompasses logical mutators.
| Yield_ | `yield $a => $b;` | `yield $a > $b;` |
| Coalesce | `$a ?? $b` | `$b` |

#### `TrueValue`

Default settings:

* `in_array: false`: whether to mutate 3rd argument `true` in function call
* `array_search: false`: whether to mutate 3rd argument `true` in function call

infection.json:

```json
{
"mutators": {
"TrueValue": {
"settings": {
"in_array": true,
"array_search": true
}
}
}
}
```

### Conditional Boundaries

| Name | Original | Mutated
Expand Down