Ejemplo n.º 1
0
 /**
  * @covers OAuth\OAuth1\Service\Etsy::__construct
  * @covers OAuth\OAuth1\Service\Etsy::getRequestTokenEndpoint
  * @covers OAuth\OAuth1\Service\Etsy::parseAccessTokenResponse
  */
 public function testParseAccessTokenResponseValid()
 {
     $client = $this->getMock('\\OAuth\\Common\\Http\\Client\\ClientInterface');
     $client->expects($this->once())->method('retrieveResponse')->will($this->returnValue('oauth_token=foo&oauth_token_secret=bar'));
     $token = $this->getMock('\\OAuth\\OAuth1\\Token\\TokenInterface');
     $storage = $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface');
     $storage->expects($this->any())->method('retrieveAccessToken')->will($this->returnValue($token));
     $service = new Etsy($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $client, $storage, $this->getMock('\\OAuth\\OAuth1\\Signature\\SignatureInterface'));
     $this->assertInstanceOf('\\OAuth\\OAuth1\\Token\\StdOAuth1Token', $service->requestAccessToken('foo', 'bar', $token));
 }
Ejemplo n.º 2
0
 /**
  * @covers OAuth\OAuth1\Service\Etsy::__construct
  * @covers OAuth\OAuth1\Service\Etsy::getAccessTokenEndpoint
  */
 public function testGetAccessTokenEndpoint()
 {
     $service = new Etsy($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $this->getMock('\\Buzz\\Browser'), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface'), $this->getMock('\\OAuth\\OAuth1\\Signature\\SignatureInterface'));
     $this->assertSame('https://openapi.etsy.com/v2/oauth/access_token', (string) $service->getAccessTokenEndpoint());
 }