Skip to content

Why is a failed test marked as successful with 'retry successful' notice in PHPUnit?

A failed test in PHPUnit may be marked as successful with a ‘retry successful’ notice if test IDs are reused due to @group annotations in your test code.

  1. Check @group Annotations: Review your test code for @group annotations. These annotations specify test IDs and map tests from your source code to testomat.io. Ensure that no test IDs are reused.

  2. Remove @group Usages: If you find that test IDs are reused, consider removing the @group annotations that are linked to testomat.io.

  3. Verify PHPUnit Version Compatibility: Ensure that your PHPUnit version is compatible with the php-list-tests feature. Different PHPUnit versions may introduce breaking changes, which can affect compatibility.

  • The php-list-tests feature should work with PHPUnit, but compatibility depends on the specific version of PHPUnit you are using.