diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-12-18 15:48:49 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-12-18 15:48:49 +0100 |
commit | 439d41b194073285ab97be94253b3f4cb4395e43 (patch) | |
tree | 272d4c64ea2d766235ecb41009117b5269f8cdfd /vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller | |
parent | 08a8f195e749a120642f6c486c1dad62a73924d1 (diff) | |
download | volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.gz volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.bz2 volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.zip |
install smarty via composer and update other php libs
Diffstat (limited to 'vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller')
3 files changed, 48 insertions, 3 deletions
diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/AuthorizeControllerTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/AuthorizeControllerTest.php index 3bfc760e4..fe3553b23 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/AuthorizeControllerTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/AuthorizeControllerTest.php @@ -10,8 +10,9 @@ use OAuth2\GrantType\AuthorizationCode; use OAuth2\Request; use OAuth2\Response; use OAuth2\Request\TestRequest; +use PHPUnit\Framework\TestCase; -class AuthorizeControllerTest extends \PHPUnit_Framework_TestCase +class AuthorizeControllerTest extends TestCase { public function testNoClientIdResponse() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/ResourceControllerTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/ResourceControllerTest.php index b277514a5..cd54d239a 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/ResourceControllerTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/ResourceControllerTest.php @@ -7,8 +7,9 @@ use OAuth2\Server; use OAuth2\GrantType\AuthorizationCode; use OAuth2\Request; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class ResourceControllerTest extends \PHPUnit_Framework_TestCase +class ResourceControllerTest extends TestCase { public function testNoAccessToken() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/TokenControllerTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/TokenControllerTest.php index 4a217bd55..d18eaa6d7 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/TokenControllerTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/TokenControllerTest.php @@ -10,8 +10,9 @@ use OAuth2\GrantType\UserCredentials; use OAuth2\Scope; use OAuth2\Request\TestRequest; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class TokenControllerTest extends \PHPUnit_Framework_TestCase +class TokenControllerTest extends TestCase { public function testNoGrantType() { @@ -271,6 +272,48 @@ class TokenControllerTest extends \PHPUnit_Framework_TestCase $this->assertEquals($response->getParameter('error_description'), 'The request method must be POST when revoking an access token'); } + public function testCanUseCrossOriginRequestForRevoke() + { + $server = $this->getTestServer(); + + $request = new TestRequest(); + $request->setMethod('OPTIONS'); + + $server->handleRevokeRequest($request, $response = new Response()); + $this->assertTrue($response instanceof Response); + $this->assertEquals(200, $response->getStatusCode(), var_export($response, 1)); + $this->assertEquals($response->getHttpHeader('Allow'), 'POST, OPTIONS'); + } + + public function testInvalidRequestMethodForAccessToken() + { + $server = $this->getTestServer(); + + $request = new TestRequest(); + $request->setQuery(array( + 'token_type_hint' => 'access_token' + )); + + $server->handleTokenRequest($request, $response = new Response()); + $this->assertTrue($response instanceof Response); + $this->assertEquals(405, $response->getStatusCode(), var_export($response, 1)); + $this->assertEquals($response->getParameter('error'), 'invalid_request'); + $this->assertEquals($response->getParameter('error_description'), 'The request method must be POST when requesting an access token'); + } + + public function testCanUseCrossOriginRequestForAccessToken() + { + $server = $this->getTestServer(); + + $request = new TestRequest(); + $request->setMethod('OPTIONS'); + + $server->handleTokenRequest($request, $response = new Response()); + $this->assertTrue($response instanceof Response); + $this->assertEquals(200, $response->getStatusCode(), var_export($response, 1)); + $this->assertEquals($response->getHttpHeader('Allow'), 'POST, OPTIONS'); + } + public function testCreateController() { $storage = Bootstrap::getInstance()->getMemoryStorage(); |