title: Test database not found using Laravel sail
body: <p>I'm using Laravel Sail for the first time and can connect to my database, as well as connect to the test database using TablePlus after <a href="https://stackoverflow.com/questions/66618511/cant-connect-to-test-database-with-docker-and-laravel-sail/66618578">changing ports</a> with credentials Host: 127.0.0.1, Port: 3307, User: test_root, Password: test_root.  However, when I run</p>
  <pre><code>sail test --testsuite Feature --filter=LoginAsTest
  </code></pre>
  <p>I get:</p>
  <blockquote>
  <p>SQLSTATE[HY000] [1049] Unknown database 'test_database' (SQL: SHOW FULL TABLES WHERE table_type = 'BASE TABLE')</p>
  </blockquote>
  <p>In my .env file I have:</p>
  <pre><code>TEST_DB_CONNECTION=mysql
  TEST_DB_HOST=mysql_test
  TEST_DB_PORT=3306
  TEST_DB_DATABASE=test_database
  TEST_DB_USERNAME=test_root
  TEST_DB_PASSWORD=test_root
  </code></pre>
  <p>and my docker-compose.yml has:</p>
  <pre><code>mysql:
      image: 'mysql:8.0'
      ports:
          - '${FORWARD_DB_PORT:-3306}:3306'
      environment:
          MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
          MYSQL_DATABASE: '${DB_DATABASE}'
          MYSQL_USER: '${DB_USERNAME}'
          MYSQL_PASSWORD: '${DB_PASSWORD}'
          MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
      volumes:
          - 'sailmysql:/var/lib/mysql'
      networks:
          - sail
      healthcheck:
        test: [&quot;CMD&quot;, &quot;mysqladmin&quot;, &quot;ping&quot;]
  mysql_test:
    image: &quot;mysql:8.0&quot;
    ports:
      - '${FORWARD_DB_PORT:-3307}:3306'
    environment:
      MYSQL_ROOT_PASSWORD: &quot;${TEST_DB_PASSWORD}&quot;
      MYSQL_DATABASE: &quot;${TEST_DB_DATABASE}&quot;
      MYSQL_USER: &quot;${TEST_DB_USERNAME}&quot;
      MYSQL_PASSWORD: &quot;${TEST_DB_PASSWORD}&quot;
      MYSQL_ALLOW_EMPTY_PASSWORD: &quot;yes&quot;
    networks:
      - sail
  </code></pre>
  <p>Any thoughts as to why I can connect via TablePlus, but not my application?</p>
  <p>Update: I've also added:</p>
  <pre><code>'mysql_test' =&gt; [
              'driver' =&gt; 'mysql',
              'host' =&gt; env('DB_HOST', '127.0.0.1'),
              'port' =&gt; env('TEST_DB_PORT', '3306'),
              'database' =&gt; env('TEST_DB_DATABASE', 'forge'),
              'username' =&gt; env('TEST_DB_USERNAME', 'forge'),
              'password' =&gt; env('TEST_DB_PASSWORD', ''),
              'unix_socket' =&gt; env('DB_SOCKET', ''),
              'charset' =&gt; 'utf8mb4',
              'collation' =&gt; 'utf8mb4_unicode_ci',
              'prefix' =&gt; '',
              'prefix_indexes' =&gt; true,
              'strict' =&gt; true,
              'engine' =&gt; null,
              'options' =&gt; extension_loaded('pdo_mysql') ? array_filter([
                  PDO::MYSQL_ATTR_SSL_CA =&gt; env('MYSQL_ATTR_SSL_CA'),
              ]) : [],
          ],
  </code></pre>
  <p>to my config/database.php</p>
  <p>and in my phpunit.xml I have:</p>
  <pre><code> &lt;env name=&quot;DB_CONNECTION&quot; value=&quot;mysql_test&quot;/&gt;
   &lt;env name=&quot;DB_DATABASE&quot; value=&quot;test_database&quot;/&gt;
  </code></pre>