This plugin watches a change on source & test files and execute phpunit.
It uses grunt-este-watch
npm install grunt-phpunit-onefile --save-dev
grunt.loadNpmTasks('phpunitOnefile');
// if default
grunt.registerTask('default', ['esteWatch']);
This module depends on (grunt-este-watch)[https://github.com/steida/grunt-este-watch]
grunt.initConfig({
esteWatch: {
options: {
dirs: [
'src/**/',
'tests/**/'
]
},
php: function (filepath) {
grunt.config(['phpunitOnefile', 'filepath'], filepath);
return ['phpunitOnefile'];
}
},
phpunitOnefile: {
options: {
bin: 'vendor/bin/phpunit',
dirmap: [
{ from: 'src/', to: 'tests/'}
]
}
}
// ....
'dirmap' replaces directory path.
For example, changing source file to executing test file.
@misogi