Added more api tests
This commit is contained in:
@@ -20,5 +20,26 @@ class GeneralTest extends AbstractTestCase
|
|||||||
$this->get('/api/v1/ping');
|
$this->get('/api/v1/ping');
|
||||||
$this->seeJson(['data' => 'Pong!']);
|
$this->seeJson(['data' => 'Pong!']);
|
||||||
$this->assertResponseOk();
|
$this->assertResponseOk();
|
||||||
|
$this->seeHeader('Content-Type', 'application/json');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testErrorPage()
|
||||||
|
{
|
||||||
|
$this->get('/api/v1/not-found');
|
||||||
|
|
||||||
|
$this->assertResponseStatus(404);
|
||||||
|
$this->seeHeader('Content-Type', 'application/json');
|
||||||
|
$this->seeJson(['errors' => [[
|
||||||
|
'status' => 404,
|
||||||
|
'title' => 'Not Found',
|
||||||
|
'detail' => 'The requested resource could not be found but may be available again in the future.',
|
||||||
|
]]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testNotAcceptableContentType()
|
||||||
|
{
|
||||||
|
$this->get('/api/v1/ping', ['HTTP_Accept' => 'text/html']);
|
||||||
|
|
||||||
|
$this->assertResponseStatus(406);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user