Skip to content

Instantly share code, notes, and snippets.

@glebcha
Created November 25, 2014 05:19
Show Gist options
  • Save glebcha/df47079c4ca4a0811d16 to your computer and use it in GitHub Desktop.
Save glebcha/df47079c4ca4a0811d16 to your computer and use it in GitHub Desktop.
Запуск модульных тестов для PHP в Gulp
//Запуск модульных тестов при изменении какого-либо php-файла в проекте
var phpunit = require('gulp-phpunit');
var gulp = require('gulp'),
notify = require('gulp-notify'),
phpunit = require('gulp-phpunit');
gulp.task('phpunit', function() {
var options = {debug: false, notify: true};
gulp.src('app/tests/*.php')
.pipe(phpunit('', options))
.on('error', notify.onError({
title: "Ошибка!",
message: "Тестирование выполнено с ошибкой..."
}));
});
gulp.task('default', function(){
gulp.run('phpunit');
gulp.watch('app/**/*.php', function(){
gulp.run('phpunit');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment