AdvancedLearning\Oauth2Server\Tests\GraphqlTest
Synopsis
class GraphqlTest
extends SapphireTest
{
- // members
- protected static string $fixture_file = 'tests/OAuthFixture.yml';
- protected static string $privateKeyFile = 'private.key';
- protected static string $publicKeyFile = 'public.key';
- // methods
- public void setUp()
- public void testGraphQLMember()
- public void testGraphQLContexts()
- public void testNoClient()
- protected AuthorizationServer getAuthorisationServer()
- protected ResourceServer getResourceServer()
- protected string getPrivateKeyPath()
- protected string getPublicKeyPath()
- protected void tearDown()
- protected ResponseInterface generateClientAccessToken()
- protected ServerRequest getClientRequest()
- // Inherited methods from OauthContext
- public bool hasOauthClient()
- public DataObject getOauthClient()
- public bool hasScope()
- public bool hasScopes()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Uses
- League\OAuth2\Server\CryptTrait
- Riddler7\Oauth2GraphQL\Helpers\OauthContext
Members
protected
- $fixture_file
- $oauthClientKey
—
string
Name of the oauth client id in the graphql context. - $oauthScopesKey
—
string
Name of the oauth scopes in the graphql context. - $privateKeyFile
- $publicKeyFile
Methods
protected
- generateClientAccessToken() — Generates a response with an access token using the client grant.
- getAuthorisationServer() — Setup the Authorization Server.
- getClientRequest() — Get PSR7 request object to be used for a client grant.
- getPrivateKeyPath() — Get the full path the private key.
- getPublicKeyPath() — Get the full path the public key.
- getResourceServer() — Get the resource server.
- tearDown() — Cleanup test environment.
public
- setUp() — Setup test environment.
- testGraphQLContexts()
- testGraphQLMember()
- testNoClient() — Verify an error response is returned if there is no oauth client.
Inherited from Riddler7\Oauth2GraphQL\Helpers\OauthContext
public
- getOauthClient() — Return the model for the Oauth Client.
- hasOauthClient() — Determine if the scope has a valid client.
- hasScope() — Determine whether the a scope has been granted.
- hasScopes() — Determnie whether all the scopes have been granted.