Skip to content

Instantly share code, notes, and snippets.

@BradEstey
Last active December 21, 2018 05:49
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save BradEstey/8568564 to your computer and use it in GitHub Desktop.
Save BradEstey/8568564 to your computer and use it in GitHub Desktop.
Use Gulp to automatically run PHPUnit tests.
var gulp = require('gulp'),
sys = require('sys'),
exec = require('child_process').exec;
gulp.task('phpunit', function() {
exec('phpunit', function(error, stdout) {
sys.puts(stdout);
});
});
gulp.task('default', function() {
gulp.watch('**/*.php', { debounceDelay: 2000 }, ['phpunit']);
});
@BradEstey
Copy link
Author

Removed gulp.run()

The { debounceDelay: 2000 } is optional, but it keep tasks from running twice.. if you run into that issue. Change the delay (currently 2 seconds) as needed.

@alairock
Copy link

alairock commented Feb 8, 2014

I love this! The only thing it's missing is the ability to run the test on the current edited file only. Any thoughts on this?

@xtrasmal
Copy link

Gulp..means "zipper" in Dutch. FYI! Keep the party alive!

@jancbeck
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment