mk-conn's avatar

Testing route with DELETE and GET in one test

Hi,

following is in a test

$this->json('DELETE', self::API_URL . '/' . $id)
             ->assertStatus(Response::HTTP_NO_CONTENT);

$response = $this->json('GET', self::API_URL)
                         ->decodeResponseJson();

The first test call to the api works great, but the second is somehow interpreted as DELETE request, which obviously fails and is not what is wanted ...

Is it not possible at all to have more than one request in a test method - are the routes/whatever cached somehow ore reused?

0 likes
0 replies

Please or to participate in this conversation.