Testing a route with a query string in PHPUnit/Laravel
<p>I am trying to test a route that will return a status code 500 if not visited with the correct query string parameter.</p>

<p>The route is <a href="http://localhost:8000/apiRequest?q=ASX.AX" rel="nofollow noreferrer">http://localhost:8000/apiRequest?q=ASX.AX</a></p>

<p>I have done this</p>

<pre><code>public function test_api_response()
{
    $user = factory(User::class)-&gt;create();

    $response = $this-&gt;actingAs($user)-&gt;call('GET', '/apiRequest', ['_token' =&gt; Session::token()], $parameters = ["q" =&gt; "ASX.AX"]);

    $this-&gt;assertEquals(200, $response-&gt;status());  
}
</code></pre>

<p>But the response is 500. Any help?</p>