Skip to content

Instantly share code, notes, and snippets.

View mikemiller891's full-sized avatar

Mike Miller mikemiller891

View GitHub Profile
@mikemiller891
mikemiller891 / phpunit.xml
Created October 8, 2020 20:55
A phpunit config for Laravel 8 to generate a code coverage report.
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
@mikemiller891
mikemiller891 / getcomposer
Created September 30, 2020 15:40
Get the latest composer.phar
#!/bin/sh
EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php