Laravel ignores testing database connection
<p>I use Laravel 5.3.22 and want to unit-test my application using an in-memory sqlite database migrating/rolling back for every test as it's said <a href="https://laravel.com/docs/5.3/database-testing#using-migrations" rel="noreferrer">here</a>. This is the connections section my database.php config:</p>

<pre><code>'mysql' =&gt; [
            'driver'    =&gt; 'mysql',
            'host'      =&gt; env('DB_HOST', 'localhost'),
            'database'  =&gt; env('DB_DATABASE', 'forge'),
            'username'  =&gt; env('DB_USERNAME', 'forge'),
            'password'  =&gt; env('DB_PASSWORD', ''),
            ...
        ],

        'testing' =&gt; [
            'driver'   =&gt; 'sqlite',
            'database' =&gt; ':memory:',
            'prefix'   =&gt; '',
        ],
</code></pre>

<p>This is the phpunit env config:</p>

<pre><code>&lt;php&gt;
    &lt;env name="APP_ENV" value="testing"/&gt;
    &lt;env name="CACHE_DRIVER" value="array"/&gt;
    &lt;env name="SESSION_DRIVER" value="array"/&gt;
    &lt;env name="QUEUE_DRIVER" value="sync"/&gt;
    &lt;env name="DB_CONNECTION" value="testing"/&gt;
&lt;/php&gt;
</code></pre>

<p>The phpunit config implies that laravel shoud use the "testing" sqlite connection for testing, but it doesn't care and go on with the primary mysql connection. This is not an option, I have a big and complex schema and it can't be used for unit-testing with mysql. How do I proceed? I can't mock the query builder since I need to assert on it's results.</p>