Run PHPUnit tests on change

后端 未结 10 1811
星月不相逢
星月不相逢 2021-02-07 11:34

I\'d like to run my PHPUnit tests (or at least a subset of them) whenever a file changes on disk. Very similar to what you can do with \"grunt watch\". I have a project in which

10条回答
  •  無奈伤痛
    2021-02-07 12:07

    I've created a solution to deal with this very problem: "What's Changed?" In short, there are cases where you have some really large test suites and you only want to run the tests relevant to the classes which have changed.

    You can pull this in via composer by running composer require --dev icyapril/whats-changed

    With this in place just run ./vendor/bin/whatschanged and only the file changed in your last commit or in your working directory will be run. Magic!

提交回复
热议问题