diff options
author | zotlabs <mike@macgirvin.com> | 2017-07-05 15:35:05 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-07-05 15:35:05 -0700 |
commit | fca8e0aa6ac9d4f2084371486e906d7e3726a5a5 (patch) | |
tree | 81d27ea002828a42c53541f741bad44684a2c601 /library/oauth2/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php | |
parent | 41111bcdadcd16ebc4f078fc812eb5a290f185e5 (diff) | |
parent | 8dd9ab05a97f92f9eca5d527e48272f3a44010a8 (diff) | |
download | volse-hubzilla-fca8e0aa6ac9d4f2084371486e906d7e3726a5a5.tar.gz volse-hubzilla-fca8e0aa6ac9d4f2084371486e906d7e3726a5a5.tar.bz2 volse-hubzilla-fca8e0aa6ac9d4f2084371486e906d7e3726a5a5.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'library/oauth2/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php')
-rw-r--r-- | library/oauth2/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/library/oauth2/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php b/library/oauth2/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php deleted file mode 100644 index b1b687077..000000000 --- a/library/oauth2/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace OAuth2\OpenID\Controller; - -use OAuth2\Storage\Bootstrap; -use OAuth2\Server; -use OAuth2\Request; -use OAuth2\Response; - -class UserInfoControllerTest extends \PHPUnit_Framework_TestCase -{ - public function testCreateController() - { - $tokenType = new \OAuth2\TokenType\Bearer(); - $storage = new \OAuth2\Storage\Memory(); - $controller = new UserInfoController($tokenType, $storage, $storage); - - $response = new Response(); - $controller->handleUserInfoRequest(new Request(), $response); - $this->assertEquals(401, $response->getStatusCode()); - } - - public function testValidToken() - { - $server = $this->getTestServer(); - $request = Request::createFromGlobals(); - $request->headers['AUTHORIZATION'] = 'Bearer accesstoken-openid-connect'; - $response = new Response(); - - $server->handleUserInfoRequest($request, $response); - $parameters = $response->getParameters(); - $this->assertEquals($parameters['sub'], 'testuser'); - $this->assertEquals($parameters['email'], 'testuser@test.com'); - $this->assertEquals($parameters['email_verified'], true); - } - - private function getTestServer($config = array()) - { - $storage = Bootstrap::getInstance()->getMemoryStorage(); - $server = new Server($storage, $config); - - return $server; - } -} |