1

I am trying to test a route that will return a status code 500 if not visited with the correct query string parameter.

The route is http://localhost:8000/apiRequest?q=ASX.AX

I have done this

public function test_api_response()
{
    $user = factory(User::class)->create();

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

    $this->assertEquals(200, $response->status());  
}

But the response is 500. Any help?

1

1 Answer 1

0

Try changing $parameters = ["q" => "ASX.AX"] for $parameters = ["q" => "AXS.AX"].

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.