-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
35 lines (31 loc) · 932 Bytes
/
gulpfile.js
File metadata and controls
35 lines (31 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Requires
var gulp = require('gulp')
plumber = require('gulp-plumber'),
notify = require('gulp-notify'),
phpunit = require('gulp-phpunit');
// Paths
var phpunit_path = 'bin/phpunit',
php_files = ['src/**/*.php', 'tests/**/*.php'];
// Task
gulp.task('phpunit', function() {
return gulp.src('phpunit.xml')
.pipe(plumber({errorHandler: notify.onError({
title: "[PHPUnit] Failed!",
message: "Make it pass!",
icon: __dirname + '/fail.png'
})}))
.pipe(phpunit(phpunit_path, {
notify: true,
clear: true,
debug: false
}))
.pipe(notify({
title: "[PHPUnit] Passed!",
message: "Time to refactor!",
icon: __dirname + '/pass.png'
}));
});
gulp.task('watch', function() {
gulp.watch(php_files, ['phpunit']);
});
gulp.task('default', ['phpunit', 'watch']);