/** * @param \EasyBib\OAuth2\Client\TokenResponse\TokenResponse $tokenResponse */ public function updateFromTokenResponse(TokenResponse $tokenResponse) { // don't use replace(), as that resets first and then sets $this->session->set(self::KEY_ACCESS_TOKEN, $tokenResponse->getToken()); $this->session->set(self::KEY_REFRESH_TOKEN, $tokenResponse->getRefreshToken()); $this->session->set(self::KEY_EXPIRES_AT, $this->expirationTimeFor($tokenResponse)); }
/** * @dataProvider getErrorParamSets * @param array $params * @param $expectedError */ public function testGetTokenWithErrorCondition(array $params, $expectedError) { $incomingToken = new TokenResponse($this->getHttpResponse($params)); $exceptionClass = '\\EasyBib\\OAuth2\\Client\\TokenResponse\\TokenRequestErrorException'; $this->setExpectedException($exceptionClass, $expectedError); $incomingToken->getToken(); }