Skip to content

IncrementInteger and preg_match_all #1559

Closed Answered by maks-rafalko
mfn asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, on your example, $m[0] returns 1 while $m[1] returns 2, so we can write a test that checks exact value.

If it doesn't matter which integer value is returned, then probably you can do the following:

  1. replace return $m[0] with current($m). IncrementInteger mutator in this case won't be applied
  2. Ignore IncrementInteger mutator in this method or even line of code. See how: https://infection.github.io/guide/how-to.html#How-to-disable-Mutators-and-profiles

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@mfn
Comment options

Answer selected by mfn
Comment options

You must be logged in to vote
1 reply
@mfn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants