title: Doctrine\DBAL\Driver\PDOException: could not find driver when trying to use a factory in my unit tests
body: <p>My unit tests work fine as long as I do not try to mock a DB object.  I created a Factory and am trying to use it in one of my tests. However, I keep getting <code>a could not find driver error</code>.  I have looked up a couple of stack answers and my version of php is 7.1, so not really sure what is causing the error.</p>
  
  <p>Here is my testing class.</p>
  
  <pre><code>&lt;?php
  /**
   * Created by PhpStorm.
   */
  
  namespace Tests\Unit\Helper\Results;
  
  use Jobscan\Helper\Results\FormatHelper;
  use Illuminate\Foundation\Testing\WithFaker;
  use Illuminate\Foundation\Testing\RefreshDatabase;
  use Illuminate\Foundation\Testing\WithoutMiddleware;
  use Jobscan\Models\Document\Cv;
  use Tests\TestCase;
  
  class FormatHelperTest extends TestCase
  {
      public function testFindingsForUploadedDocxResume_whenFontTypeIsNotStandard_resultFontTypeShowsNegativeResult()
      {
          $cv = factory(Cv::class)-&gt;create([
              'content' =&gt; "Testing Test test",
          ]);
          dd($cv);
  
  
  
   }
  }
  </code></pre>
  
  <p>In my phpunit test</p>
  
  <pre><code>&lt;env name="DB_CONNECTION" value="test_db"/&gt;
  &lt;env name="DB_DATABASE" value=":memory:"/&gt;
  </code></pre>
  
  <p>This is the error I keep getting</p>
  
  <pre><code> Caused by
   Doctrine\DBAL\Driver\PDOException: could not find driver
  </code></pre>
  
  <p>database.php file</p>
  
  <pre><code> // This database is ephemeral and used for testing purposes.
          'test_db' =&gt; [
              'driver'   =&gt; 'sqlite',
              'database' =&gt; ':memory:',
              'prefix'   =&gt; '',
          ],
  </code></pre>