public function testMultipleValuedResponseTypeOrderDoesntMatter() { $responseType = $this->getMock('OAuth2\\OpenID\\ResponseType\\IdTokenTokenInterface'); $server = new Server(array(), array(), array(), array('token id_token' => $responseType)); $this->assertEquals($responseType, $server->getResponseType('id_token token')); }
public function testUsingOpenIDConnectWithAllowImplicitAndAccessTokenResponseTypeIsOkay() { $client = $this->getMock('OAuth2\\Storage\\ClientInterface'); $userclaims = $this->getMock('OAuth2\\OpenID\\Storage\\UserClaimsInterface'); $pubkey = $this->getMock('OAuth2\\Storage\\PublicKeyInterface'); // $token = $this->getMock('OAuth2\Storage\AccessTokenInterface'); $server = new Server(array($client, $userclaims, $pubkey), array('use_openid_connect' => true, 'issuer' => 'someguy', 'allow_implicit' => true)); $token = $this->getMock('OAuth2\\ResponseType\\AccessTokenInterface'); $server->addResponseType($token, 'token'); $server->getAuthorizeController(); $this->assertInstanceOf('OAuth2\\OpenID\\ResponseType\\IdTokenInterface', $server->getResponseType('id_token')); $this->assertInstanceOf('OAuth2\\OpenID\\ResponseType\\TokenIdTokenInterface', $server->getResponseType('token id_token')); }