Beispiel #1
0
 /**
  * @covers OAuth\OAuth1\Service\Etsy::__construct
  * @covers OAuth\OAuth1\Service\Etsy::getRequestTokenEndpoint
  */
 public function testGetRequestTokenEndpoint()
 {
     $service = new Etsy($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $this->getMock('\\OAuth\\Common\\Http\\Client\\ClientInterface'), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface'), $this->getMock('\\OAuth\\OAuth1\\Signature\\SignatureInterface'));
     $this->assertSame('https://openapi.etsy.com/v2/oauth/request_token', $service->getRequestTokenEndpoint()->getAbsoluteUri());
     $service->setScopes(array('email_r', 'cart_rw'));
     $this->assertSame('https://openapi.etsy.com/v2/oauth/request_token?scope=email_r%20cart_rw', $service->getRequestTokenEndpoint()->getAbsoluteUri());
 }
Beispiel #2
0
 /**
  * @covers OAuth\OAuth1\Service\Etsy::__construct
  * @covers OAuth\OAuth1\Service\Etsy::getRequestTokenEndpoint
  */
 public function testGetRequestTokenEndpoint()
 {
     $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/request_token', (string) $service->getRequestTokenEndpoint());
     $service->setScopes(['email_r', 'cart_rw']);
     $this->assertSame('https://openapi.etsy.com/v2/oauth/request_token?scope=email_r%20cart_rw', (string) $service->getRequestTokenEndpoint());
 }