Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Run phpunit pre-commit stop commit if failed.
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;
} else {
echo 'All tests passed.' . PHP_EOL;
echo PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment