title: Laravel & PHPUnit: Getting 500 when unit testing "Passport" restricted route
body: <p>I have a Laravel 5.3 app. </p>
  
  <p>Inside my <code>api.php</code> file, there's a route for posting an answer within a poll. </p>
  
  <p><code>Route::group(['middleware' =&gt; 'auth:api'], function () {
      Route::post('/poll/answer', 'API\PollsController@createAnswer');
  });</code></p>
  
  <p>The route is part of a group, restricted by the <code>auth:api</code> middleware, using Laravel's Passport engine. </p>
  
  <p>When calling this route from Postman or any other tool to test APIs, I get 401 which is ok because I'm not attaching the token. </p>
  
  <p>But when unit testing this call using PHPUnit, it returns 500. I have no idea why. </p>
  
  <p><code>$this-&gt;postJson('api/poll/answer');</code></p>
  
  <p>I'm probably missing a configuration or setup instruction. </p>
  
  <p>Any ideas?</p>