title: Lumen PHPUNIT not using the .env.testing
body: <p>I am having an issue in Lumen with testing. I have my <code>phpunit.xml</code> as such:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;phpunit backupGlobals="false"
           backupStaticAttributes="false"
           bootstrap="vendor/autoload.php"
           colors="true"
           convertErrorsToExceptions="true"
           convertNoticesToExceptions="true"
           convertWarningsToExceptions="true"
           processIsolation="false"
           stopOnFailure="false"&gt;
      &lt;testsuites&gt;
          &lt;testsuite name="Application Test Suite"&gt;
              &lt;directory suffix="Test.php"&gt;./tests&lt;/directory&gt;
          &lt;/testsuite&gt;
      &lt;/testsuites&gt;
      &lt;filter&gt;
          &lt;whitelist processUncoveredFilesFromWhitelist="true"&gt;
              &lt;directory suffix=".php"&gt;./app&lt;/directory&gt;
          &lt;/whitelist&gt;
      &lt;/filter&gt;
      &lt;php&gt;
          &lt;env name="APP_ENV" value="testing"/&gt;
          &lt;env name="CACHE_DRIVER" value="array"/&gt;
          &lt;env name="QUEUE_CONNECTION" value="sync"/&gt;
      &lt;/php&gt;
  &lt;/phpunit&gt;
  </code></pre>
  
  <p>And I have a .env.testing file as well. But when I run <code>vendor/bin/phpunit tests/</code>, it's using the main <code>.env</code> and not the <code>.env.testing</code>. </p>
  
  <p>Also my <code>bootstrap/app.php</code> being loaded from <code>test/TestCase.php</code> is as such:</p>
  
  <pre><code>&lt;?php
  
  require_once __DIR__.'/../vendor/autoload.php';
  
  (new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
      dirname(__DIR__)
  ))-&gt;bootstrap();
  
  /*
  |--------------------------------------------------------------------------
  | Create The Application
  |--------------------------------------------------------------------------
  |
  | Here we will load the environment and create the application instance
  | that serves as the central piece of this framework. We'll use this
  | application as an "IoC" container and router for this framework.
  |
  */
  
  $app = new Laravel\Lumen\Application(
      dirname(__DIR__)
  );
  
   $app-&gt;withFacades();
  
   $app-&gt;withEloquent();
  
  /*
  |--------------------------------------------------------------------------
  | Register Container Bindings
  |--------------------------------------------------------------------------
  |
  | Now we will register a few bindings in the service container. We will
  | register the exception handler and the console kernel. You may add
  | your own bindings here if you like or you can make another file.
  |
  */
  
  $app-&gt;singleton(
      Illuminate\Contracts\Debug\ExceptionHandler::class,
      App\Exceptions\Handler::class
  );
  
  $app-&gt;singleton(
      Illuminate\Contracts\Console\Kernel::class,
      App\Console\Kernel::class
  );
  
  $app-&gt;instance('path.config', app()-&gt;basePath() . DIRECTORY_SEPARATOR . 'config');
  
  /*
  |--------------------------------------------------------------------------
  | Register Middleware
  |--------------------------------------------------------------------------
  |
  | Next, we will register the middleware with the application. These can
  | be global middleware that run before and after each request into a
  | route or middleware that'll be assigned to some specific routes.
  |
  */
  
  // $app-&gt;middleware([
  //     App\Http\Middleware\ExampleMiddleware::class
  // ]);
  
   $app-&gt;routeMiddleware([
       'auth' =&gt; App\Http\Middleware\Authenticate::class,
       'client' =&gt; \Laravel\Passport\Http\Middleware\CheckClientCredentials::class,
   ]);
  
  $app-&gt;middleware([
      Spatie\Cors\Cors::class,
  ]);
  
  $app-&gt;configure('cors');
  
  $app-&gt;configure('lighthouse');
  $app-&gt;configure('graphql-playground');
  
  /*
  |--------------------------------------------------------------------------
  | Register Service Providers
  |--------------------------------------------------------------------------
  |
  | Here we will register all of the application's service providers which
  | are used to bind services into the container. Service providers are
  | totally optional, so you are not required to uncomment this line.
  |
  */
  
  
  // $app-&gt;register(App\Providers\AuthServiceProvider::class);
  // $app-&gt;register(App\Providers\EventServiceProvider::class);
  $app-&gt;register(App\Providers\AppServiceProvider::class);
  $app-&gt;register(Illuminate\Mail\MailServiceProvider::class);
  $app-&gt;register(Laravel\Passport\PassportServiceProvider::class);
  $app-&gt;register(Dusterio\LumenPassport\PassportServiceProvider::class);
  $app-&gt;register(Laravel\Tinker\TinkerServiceProvider::class);
  $app-&gt;register(Illuminate\Notifications\NotificationServiceProvider::class);
  $app-&gt;register(MLL\GraphQLPlayground\GraphQLPlaygroundServiceProvider::class);
  $app-&gt;register(Appzcoder\LumenRoutesList\RoutesCommandServiceProvider::class);
  $app-&gt;register(Spatie\Cors\CorsServiceProvider::class);
  \Dusterio\LumenPassport\LumenPassport::routes($app, ['prefix' =&gt; 'api/v1/oauth']);
  
  $app-&gt;withFacades(true, [
      'Illuminate\Support\Facades\Notification' =&gt; 'Notification',
  ]);
  /*
  |--------------------------------------------------------------------------
  | Load The Application Configuration Files
  |--------------------------------------------------------------------------
  */
  
  collect(scandir(__DIR__ . '/../config'))-&gt;each(function ($item) use ($app) {
      $app-&gt;configure(basename($item, '.php'));
  });
  $app-&gt;alias('mailer', Illuminate\Mail\Mailer::class);
  $app-&gt;alias('mailer', Illuminate\Contracts\Mail\Mailer::class);
  $app-&gt;alias('mailer', Illuminate\Contracts\Mail\MailQueue::class);
  
  /*
  |--------------------------------------------------------------------------
  | Load The Application Routes
  |--------------------------------------------------------------------------
  |
  | Next we will include the routes file so that they can all be added to
  | the application. This will provide all of the URLs the application
  | can respond to, as well as the controllers that may handle them.
  |
  */
  
  $app-&gt;router-&gt;group([
      'namespace' =&gt; 'App\Http\Controllers',
  ], function ($router) {
      require __DIR__.'/../routes/web.php';
  });
  
  return $app;
  </code></pre>
  
  <p>Any ideas?</p>