0

I use the infection testing framework https://github.com/infection/infection

During a test some parts of the code are changed so that the test fails und does not run completely nor use the PHPUnit Teardown method.

My question is: Does someone know a method to use the teardown method with infection testing even if the mutants make the test fail?

I didn’t find an option in the readme. Maybe there is a way with PHPUnit to clear all test data even on fail (if there is no fatal error).

I hope my question is understandable. Excuse my bad english please.

Thanks a lot in advance.

sanmai
  • 29,083
  • 12
  • 64
  • 76

1 Answers1

0

If a tests fails with a fatal error, there are two options.

  1. If the error is catchable, then you could try your luck filing an issue with PHPUnit.
  2. If an error is not catchable, then best you could do is to explain your case by filing an issue with Infection. Maybe there's something that can be done to solve the issue at large.

Alas, you can disable the offending mutation on that line, and only.

sanmai
  • 29,083
  • 12
  • 64
  • 76