I am setting up a golden master test case, yet the result may be off at certain points due to side-effects changing some strings at known places.
Getting rid of those side-effects would be best, yet for now, I am OK with those differences being filtered out and the test case succeeding.
Yet a simple:
$this->assertSame($expected, $actual);
fails now every time.
How can I allow expected differences?
This is an example:
// THIS SHOULD PASS EVEN THOUGH TEXT IS NOT ENTIRLY THE SAME
$actual =<<<TXT
This should be the same
Here might be an expected DIFF 123 That should be ignored
This is again the same
Also this
Yet another line containing an 23 expected diff
TXT;
$expected =<<<TXT
This should be the same
Here might be an expected DIFF 177 That should be ignored
This is again the same
Also this
Yet another line containing an 42 expected diff
TXT;
Example of what should fail:
$actual =<<<TXT
This should be the same
Here might be an expected DIFF 123 That should be ignored
This is again the same
Also this
Yet another line containing an 23 expected diff
TXT;
$expected =<<<TXT
This should be the same
Here might be an expected DIFF 177 That should be ignored
This is again the same
Also this SHOULD be the same but is not
Yet another line containing an 42 expected diff
TXT;
:. Yet they should always have the same length, and appear at the same order. Each line contains part of a string that remains the same.