Skip to content

Instantly share code, notes, and snippets.

@austenc
Last active August 29, 2015 14:01
Show Gist options
  • Save austenc/fc5c1b46633a601aabae to your computer and use it in GitHub Desktop.
Save austenc/fc5c1b46633a601aabae to your computer and use it in GitHub Desktop.
Gruntfile + Vagrant + PHPunit testing using grunt-githooks and grunt-phpunit
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
githooks: {
all: {
'pre-commit': {
command: 'vagrant ssh',
taskNames: '--command',
args: '"cd /vagrant; grunt phpunit"' // add other tasks here
}
}
},
phpunit: {
classes: {
dir: 'app/tests'
},
options: {
bin: 'vendor/bin/phpunit',
colors: true
}
}
});
// Load tasks
grunt.loadNpmTasks('grunt-phpunit');
grunt.loadNpmTasks('grunt-githooks');
// Register tasks
grunt.registerTask('default', [
'phpunit'
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment