public function testRevokeRefreshTokenWithBogusTypeHint() { $tokenStorage = new Memory(array('refresh_tokens' => array('revoke' => array('mytoken')))); $this->assertEquals(array('mytoken'), $tokenStorage->getRefreshToken('revoke')); $accessToken = new AccessToken(new Memory(), $tokenStorage); $accessToken->revokeToken('revoke', 'foo'); $this->assertFalse($tokenStorage->getRefreshToken('revoke')); }
public function checkUserCredentials($username, $password) { // mocking logic to throw an exception if the user is banned if ($username === 'banned_user') { $loginException = new DomainException('User is banned', 401); $loginException->setTitle('banned'); $loginException->setType('http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html'); throw $loginException; } return parent::checkUserCredentials($username, $password); }