title: Laravel 5: Handle multiple connections and testing
body: <p>I have a Laravel 5.4 app which has models pointing to different database connections. </p>
  
  <p>For example, I have <code>User</code> pointing to a MySQL database and then <code>Company</code> pointing to a PostgreSQL database (using the <code>$connection</code> variable).</p>
  
  <p>Now, when I run PHPUnit I'd like the <code>$connection</code> variable to be replaced by what's specified in the <code>phpunit.xml</code> file, which is a SQLite in memory type of database. </p>
  
  <p>How is that achievable?</p>