protected function setUp()
 {
     parent::setUp();
     $implicitGrantType = new Implicit($this->getClientStorage(), $this->getAccessTokenStorage(), $this->getScopeResolver(), new Bearer());
     $this->getClientStorage()->add(new Client('public', null, [$implicitGrantType], [], null, 'http://google.com'));
     $this->getGrantTypeResolver()->accept($implicitGrantType);
 }
 protected function setUp()
 {
     parent::setUp();
     $authorizationCodeGrantType = new AuthorizationCode($this->getClientAuthenticator(), $this->getClientStorage(), $this->getAuthorizationCodeStorage(), $this->getAccessTokenStorage(), $this->getScopeResolver());
     $this->getClientStorage()->add(new Client('public', null, [$authorizationCodeGrantType], [], null, 'http://google.com'));
     $this->getClientStorage()->add(new Client('confidential', 'secret', [$authorizationCodeGrantType], [], null, 'http://google.com'));
     $this->getGrantTypeResolver()->accept($authorizationCodeGrantType);
 }
 protected function setUp()
 {
     parent::setUp();
     $clientCredentialsGrantType = new ClientCredentials($this->getClientAuthenticator(), $this->getAccessTokenStorage(), $this->getScopeResolver());
     $this->getClientStorage()->add(new Client('public', null, [$clientCredentialsGrantType], [new Scope('public')]));
     $this->getClientStorage()->add(new Client('confidential', 'secret', [$clientCredentialsGrantType], [new Scope('confidential')]));
     $this->getGrantTypeResolver()->accept($clientCredentialsGrantType);
 }
 protected function setUp()
 {
     parent::setUp();
     $refreshTokenGrantType = new RefreshToken($this->getClientAuthenticator(), $this->getRefreshTokenStorage(), $this->getAccessTokenStorage(), $this->getScopeResolver());
     $this->getClientStorage()->add($publicClient = new Client('public', null, [$refreshTokenGrantType]));
     $this->getClientStorage()->add($confidentialClient = new Client('confidential', 'secret', [$refreshTokenGrantType]));
     $this->getRefreshTokenStorage()->add(new OAuthRefreshToken('public', new User(), $publicClient, [new Scope('public')], time() + 60));
     $this->getRefreshTokenStorage()->add(new OAuthRefreshToken('protected', new User(), $confidentialClient, [new Scope('confidential')], time() + 60));
     $this->getGrantTypeResolver()->accept($refreshTokenGrantType);
 }
 protected function setUp()
 {
     parent::setUp();
     $admin = new User('admin', 'root', [new Scope('read'), new Scope('write')]);
     $user = new User('user', 'user', [new Scope('read')]);
     $this->getUserAuthenticator()->addUser($admin);
     $this->getUserAuthenticator()->addUser($user);
     $resourceOwnerPasswordCredentialsGrantType = new ResourceOwnerPasswordCredentials($this->getClientAuthenticator(), $this->getUserAuthenticator(), $this->getAccessTokenStorage(), $this->getScopeResolver());
     $this->getClientStorage()->add(new Client('public', null, [$resourceOwnerPasswordCredentialsGrantType], [new Scope('read')]));
     $this->getClientStorage()->add(new Client('confidential', 'secret', [$resourceOwnerPasswordCredentialsGrantType], [new Scope('read'), new Scope('write')]));
     $this->getGrantTypeResolver()->accept($resourceOwnerPasswordCredentialsGrantType);
 }