 <p>Resolution: </p> <p>SC can not determine the <code>.env</code> or <code>phpunit.xml</code> in this case, so i have to specify it in my web Test Case <code>setup</code> method: </p> <pre><code> putenv('DB_DATABASE=db_name'); putenv('DB_USERNAME=postgres'); putenv('DB_PASSWORD=postgres'); putenv('DB_CONNECTION=pgsql'); putenv('DB_PORT=5432'); </code></pre> <p>the most important variable is <code>DB_CONNECTION</code>.</p>