0

Assume we have 500 unit tests and running all of them by:

php ./vendor/bin/phpunit -c ./phpunit.xml

and 450 tests passed but failed at unit-test 451.

Now I fixed the uni-test 451 and don't want to re-run 450 tests again and just want to continue testing from 451 to the the end.

Any ideas would be appreciated

Hamed Kamrava
  • 12,359
  • 34
  • 87
  • 125
  • 3
    What if your changes make one of the earlier test fail now? – Nigel Ren Feb 08 '23 at 15:11
  • Totally agreed with @NigelRen but answer to your question could be checked [here](https://stackoverflow.com/questions/26095051/how-to-run-single-test-method-with-phpunit). – Tpojka Feb 08 '23 at 15:42
  • You can check this link maybe you may help [Link](https://stackoverflow.com/questions/7119886/re-run-last-failed-test-in-phpunit) – Istiake Feb 08 '23 at 15:56
  • I do use PHPStorm, so running only failed tests is very easy, just clicking on a specific icon, but doing that using the CLI, I think it uses `--filter`. But still, you should ALWAYS run all the tests (at least related to the change, makes no sense to run a job test that is never run on a controller you are testing, but still), all tests should be run locally – matiaslauriti Feb 08 '23 at 16:38
  • Does this answer your question? [Re-run last failed test in PHPUnit](https://stackoverflow.com/questions/7119886/re-run-last-failed-test-in-phpunit) – Rohit Gupta Feb 09 '23 at 00:19

0 Answers0