Skip to content

Instantly share code, notes, and snippets.

@RandyBooth
Created January 30, 2020 15:53
Show Gist options
  • Save RandyBooth/e08e2329a293b14e6664a01955c30d3e to your computer and use it in GitHub Desktop.
Save RandyBooth/e08e2329a293b14e6664a01955c30d3e to your computer and use it in GitHub Desktop.
#!/usr/bin/env php
<?php
echo PHP_EOL;
echo 'Running tests...' . PHP_EOL;
exec('vendor/bin/phpunit', $output, $returnCode);
if ($returnCode !== 0) {
// Show full output
echo PHP_EOL . implode($output, PHP_EOL) . PHP_EOL;
echo "Aborting commit..." . PHP_EOL;
exit(1);
}
// Show summary (last line)
echo array_pop($output) . PHP_EOL;
exit(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment