icyapril / whats-changed
Run PHPUnit tests on only classes and tests which have changed
Installs: 30
Dependents: 0
Suggesters: 0
Security: 0
Stars: 51
Watchers: 3
Forks: 7
Open Issues: 4
pkg:composer/icyapril/whats-changed
Requires
- php: >=7.0
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2025-09-29 01:57:54 UTC
README
Run PHPUnit tests only on files which have changed. Useful during development stages when working with codebases with huge test suites.
How to use
- Make sure your project is set-up with Git
- Pull in through Composer
- Run
./vendor/bin/whatschanged - Magic!
Conditions
- Only works with files ending with
.php - Assumes your classes are in
srcand tests are mapped in the exact file structure in thetestsfolder. - If a Unit Test in the
testsfolder is changed, that test is re-run - Files which are monitored are those which are changed in the working tree since your last commit and those modified in the previous commit
Examples
If src/Git.php is changed we look for a test suite in tests/GitTest.php, if the test tests/GitTest.php is changed we run that test.
Note
- I wrote this in a few hours overnight once
- This doesn't support Windows
- You should run all your tests at least once before you merge your code in. This tool is purely to aid development whilst working with a large set of tests.