laravel-intermediary

Jesse Schutt has a new tutorial on the Zaengle blog with how they created an intermediary Laravel app to sit between an existing CMS and an Email service.

The tutorial covers the initial requirements, how they solved problem, and code samples to show some of the tests.

I also like how Jesse explained out the “don’t mock what you do not own” aspect. I’ve been doing this on a new app by modifying the phpunit.xml to something like this:

<testsuites>
    <testsuite name="acceptance">
        <directory>./tests/acceptance/</directory>
    </testsuite>
    <testsuite name="unit">
        <directory>./tests/unit/</directory>
    </testsuite>
    <testsuite name="integration">
        <directory>./tests/integration/</directory>
    </testsuite>
</testsuites>
<groups>
    <exclude>
        <group>integration</group>
    </exclude>
</groups>

That way all the manual tests are skipped but are still there and can be easily ran by specifying the suite:

phpunit --testsuite integration

If you have a nicer solution let me know in the comments.

Source: Laravel News