Created
January 28, 2015 13:59
-
-
Save johndrinkwater/cd96810e3b277b7e2fb1 to your computer and use it in GitHub Desktop.
This pre-commit hook should be placed in the file $repo/.git/hooks/pre-commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
exec("phpunit --configuration .phpunit.xml", $output, $returnCode ); | |
if ( $returnCode !== 0 ) { | |
$summary = array_pop( $output ); | |
printf( "Stop `git commit`, test failed with: ( %s )\n", $summary ); | |
exit( 1 ); | |
} | |
exit( 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment