Skip to content

Instantly share code, notes, and snippets.

@edgrosvenor
Created March 10, 2020 12:33
Show Gist options
  • Save edgrosvenor/f054f4a7cbd84fbe1ce63e0d27548670 to your computer and use it in GitHub Desktop.
Save edgrosvenor/f054f4a7cbd84fbe1ce63e0d27548670 to your computer and use it in GitHub Desktop.
Use Collision's PHPUnit Printer Driver by Default
<?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"
printerClass="NunoMaduro\Collision\Adapters\Phpunit\Printer">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
@edgrosvenor
Copy link
Author

The difference between this and the default phpunit.xml that ships with Laravel 7 is this line:

printerClass="NunoMaduro\Collision\Adapters\Phpunit\Printer"

inside the main phpunit block.

If you're going to use this outside of Laravel where Collision is installed by default, make sure you install Collision composer require nunomaduro/collision --dev and follow the setup instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment