Skip to content

Instantly share code, notes, and snippets.

@brichards
Forked from CamdenSegal/pre-commit
Created April 25, 2014 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brichards/11296012 to your computer and use it in GitHub Desktop.
Save brichards/11296012 to your computer and use it in GitHub Desktop.
#!/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