Skip to content

Instantly share code, notes, and snippets.

@BruceGitHub
Last active January 31, 2021 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BruceGitHub/03434f39e80b32d8d4deb70efb4bd546 to your computer and use it in GitHub Desktop.
Save BruceGitHub/03434f39e80b32d8d4deb70efb4bd546 to your computer and use it in GitHub Desktop.
How run phpunit test after change file with Node+Gulp
var gulp = require('gulp'),
util = require('util'),
exec = require('child_process').exec;
gulp.task('phpunit', function() {
exec('phpunit -c my_project_name/App', function(error, stdout) {
util.puts(stdout);
});
});
gulp.task('default',['phpunit'], function() {
gulp.watch([
'my_project_name/src/AppBundle/*/*.php',
'my_project_name/src/*.php',
'my_project_name/src/*.xml',
'my_project_name/src/*.yml',
'!my_project_name/app/bin/*/**'
], ['phpunit']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment