Last active
September 26, 2016 14:42
-
-
Save CamdenSegal/11295545 to your computer and use it in GitHub Desktop.
Run phpunit pre-commit stop commit if failed.
This file contains hidden or 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/php | |
<?php | |
echo PHP_EOL; | |
echo 'Starting unit tests' . PHP_EOL; | |
exec( 'phpunit', $test_output, $returnCode ); | |
if ( 0 !== $returnCode ) { | |
echo implode( PHP_EOL, $test_output ); | |
echo PHP_EOL; | |
exit(1); | |
} else { | |
echo 'All tests passed.' . PHP_EOL; | |
} | |
echo PHP_EOL; | |
exit(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment