mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Merge pull request #274 from nlegoff/fix_api_https
[3.7] Fix api token endpoint response code issue
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Application;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Silex\Provider\ValidatorServiceProvider;
|
||||
|
@@ -148,4 +148,15 @@ class oauthv2_application_test extends \PhraseanetWebTestCaseAuthenticatedAbstra
|
||||
$this->assertRegExp("/" . $this->queryParameters["scope"] . "/", $this->client->getResponse()->getContent());
|
||||
$this->assertRegExp("/" . $this->queryParameters["state"] . "/", $this->client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
public function testGetTokenNotHTTPS()
|
||||
{
|
||||
$acc = self::getAccount();
|
||||
|
||||
$this->setQueryParameters('grant_type', 'authorization_code');
|
||||
$this->setQueryParameters('code', '12345678918');
|
||||
$this->client->request('POST', '/token', $this->queryParameters);
|
||||
|
||||
$this->assertEquals(400, $this->client->getResponse()->getStatusCode());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user