Merge pull request #274 from nlegoff/fix_api_https

[3.7] Fix api token endpoint response code issue
This commit is contained in:
Romain Neutron
2013-01-08 11:36:04 -08:00
2 changed files with 12 additions and 0 deletions

View File

@@ -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;

View File

@@ -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());
}
}