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

Disabling mutating "true" -> "false" in TrueValue mutator for in_array/array_search #599

Merged
merged 3 commits into from Jan 21, 2019

Conversation

maks-rafalko
Copy link
Member

@maks-rafalko maks-rafalko commented Jan 5, 2019

With this PR, TrueValue mutator will no longer mutate true to false for in_array and array_search functions. This can be explicitly enabled in settings.

{
  "timeout": 25,
  "source": {
    "directories": ["src"]
  },
  "mutators": {
    "TrueValue": {
      "settings": {
        "in_array": true, // default "false"
        "array_search": true // default "false"
      }
    }
  }
}

Also, add json schema validation for TrueValue mutator in infection.json.

Fixes #578
Fixes #206

@maks-rafalko maks-rafalko added this to the 0.12.0 milestone Jan 5, 2019
@maks-rafalko maks-rafalko changed the title Disabling mutating "true" -> "false" in TrueValue mutator. Add settings for mutators Disabling mutating "true" -> "false" in TrueValue mutator for in_array/array_search Jan 5, 2019
src/Mutator/Boolean/TrueValue.php Show resolved Hide resolved
tests/Json/JsonFileTest.php Outdated Show resolved Hide resolved
src/Mutator/Arithmetic/Assignment.php Outdated Show resolved Hide resolved
src/Mutator/Boolean/TrueValue.php Outdated Show resolved Hide resolved
resources/schema.json Show resolved Hide resolved
src/Mutator/Boolean/TrueValue.php Outdated Show resolved Hide resolved
src/Mutator/Boolean/TrueValue.php Outdated Show resolved Hide resolved
tests/Mutator/Boolean/TrueValueTest.php Show resolved Hide resolved
tests/Mutator/AbstractMutatorTestCase.php Outdated Show resolved Hide resolved
Copy link
Member

@sanmai sanmai left a comment

Overall looks sensible to me.

…alse" in in_array and array_search functions.

Add json schema validation for TrueValue mutator in infection.json
@maks-rafalko
Copy link
Member Author

maks-rafalko commented Jan 11, 2019

@BackEndTea could you please review again?

@maks-rafalko
Copy link
Member Author

maks-rafalko commented Jan 21, 2019

thank you @BackEndTea @sanmai @localheinz

@maks-rafalko maks-rafalko merged commit c1fa075 into master Jan 21, 2019
7 checks passed
@ghost ghost removed the Needs Review label Jan 21, 2019
@maks-rafalko maks-rafalko deleted the mutator-settings branch Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants