mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-23 05:29:52 +05:30
Fix to broken methods
This commit is contained in:
parent
b7064befe4
commit
5410a42bb6
@ -21,7 +21,7 @@ class ClientCredentialsGrant extends AbstractGrant
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function respondToRequest(
|
public function respondToAccessTokenRequest(
|
||||||
ServerRequestInterface $request,
|
ServerRequestInterface $request,
|
||||||
ResponseTypeInterface $responseType,
|
ResponseTypeInterface $responseType,
|
||||||
\DateInterval $accessTokenTTL
|
\DateInterval $accessTokenTTL
|
||||||
|
@ -47,7 +47,7 @@ interface GrantTypeInterface extends EmitterAwareInterface
|
|||||||
*
|
*
|
||||||
* @return \League\OAuth2\Server\ResponseTypes\ResponseTypeInterface
|
* @return \League\OAuth2\Server\ResponseTypes\ResponseTypeInterface
|
||||||
*/
|
*/
|
||||||
public function respondToRequest(
|
public function respondToAccessTokenRequest(
|
||||||
ServerRequestInterface $request,
|
ServerRequestInterface $request,
|
||||||
ResponseTypeInterface $responseType,
|
ResponseTypeInterface $responseType,
|
||||||
\DateInterval $accessTokenTTL
|
\DateInterval $accessTokenTTL
|
||||||
|
@ -41,7 +41,7 @@ class PasswordGrant extends AbstractGrant
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function respondToRequest(
|
public function respondToAccessTokenRequest(
|
||||||
ServerRequestInterface $request,
|
ServerRequestInterface $request,
|
||||||
ResponseTypeInterface $responseType,
|
ResponseTypeInterface $responseType,
|
||||||
\DateInterval $accessTokenTTL
|
\DateInterval $accessTokenTTL
|
||||||
|
@ -34,7 +34,7 @@ class RefreshTokenGrant extends AbstractGrant
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function respondToRequest(
|
public function respondToAccessTokenRequest(
|
||||||
ServerRequestInterface $request,
|
ServerRequestInterface $request,
|
||||||
ResponseTypeInterface $responseType,
|
ResponseTypeInterface $responseType,
|
||||||
\DateInterval $accessTokenTTL
|
\DateInterval $accessTokenTTL
|
||||||
|
@ -250,7 +250,7 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
'grant_type' => 'foobar',
|
'grant_type' => 'foobar',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertTrue($grantMock->canRespondToRequest($serverRequest));
|
$this->assertTrue($grantMock->canRespondToAccessTokenRequest($serverRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIssueRefreshToken()
|
public function testIssueRefreshToken()
|
||||||
|
@ -47,7 +47,7 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
|
|
||||||
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
|
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
|
|
||||||
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
|
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
|
||||||
$this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface);
|
$this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface);
|
||||||
@ -99,7 +99,7 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,7 +131,7 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -165,6 +165,6 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
|
|
||||||
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
|
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
|
||||||
$this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface);
|
$this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface);
|
||||||
@ -148,7 +148,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
|
|
||||||
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
|
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
|
||||||
$this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface);
|
$this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface);
|
||||||
@ -207,7 +207,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -239,7 +239,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -274,7 +274,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -324,7 +324,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -370,7 +370,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -417,6 +417,6 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$responseType = new StubResponseType();
|
$responseType = new StubResponseType();
|
||||||
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
$grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,14 @@ namespace LeagueTests\ResponseTypes;
|
|||||||
use League\OAuth2\Server\AuthorizationValidators\BearerTokenValidator;
|
use League\OAuth2\Server\AuthorizationValidators\BearerTokenValidator;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
|
|
||||||
useLeagueTestsLeague\OAuth2\Server\CryptKey;
|
use League\OAuth2\Server\CryptKey;
|
||||||
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
||||||
use League\OAuth2\Server\ResponseTypes\BearerTokenResponse;
|
use League\OAuth2\Server\ResponseTypes\BearerTokenResponse;
|
||||||
use LeagueTests\Stubs\ClientEntity;
|
use LeagueTests\Stubs\ClientEntity;
|
||||||
use LeagueTests\Stubs\RefreshTokenEntity;
|
use LeagueTests\Stubs\RefreshTokenEntity;
|
||||||
use LeagueTests\Stubs\ScopeEntity;
|
use LeagueTests\Stubs\ScopeEntity;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Stubs\AccessTokenEntity;
|
use LeagueTests\Stubs\AccessTokenEntity;
|
||||||
use Zend\Diactoros\Response;
|
use Zend\Diactoros\Response;
|
||||||
use Zend\Diactoros\ServerRequest;
|
use Zend\Diactoros\ServerRequest;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user