forked from wallabag/wallabag
Cast client id to avoid PG error
If someone send a malformated client_id when trying to authenticate using the API we got a 500 if wallabag use postgres because the request send a string instead of an integer.
This commit is contained in:
@ -56,6 +56,20 @@ class DeveloperControllerTest extends WallabagCoreTestCase
|
||||
$this->assertArrayHasKey('refresh_token', $data);
|
||||
}
|
||||
|
||||
public function testCreateTokenWithBadClientId()
|
||||
{
|
||||
$client = $this->getClient();
|
||||
$client->request('POST', '/oauth/v2/token', [
|
||||
'grant_type' => 'password',
|
||||
'client_id' => '$WALLABAG_CLIENT_ID',
|
||||
'client_secret' => 'secret',
|
||||
'username' => 'admin',
|
||||
'password' => 'mypassword',
|
||||
]);
|
||||
|
||||
$this->assertSame(400, $client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
||||
public function testListingClient()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
|
||||
Reference in New Issue
Block a user