Example #1
0
 /**
  * @covers OAuth\OAuth1\Service\Yahoo::request
  */
 public function testRequest()
 {
     $client = $this->getMock('\\OAuth\\Common\\Http\\Client\\ClientInterface');
     $client->expects($this->once())->method('retrieveResponse')->will($this->returnValue('response!'));
     $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 Yahoo($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $client, $storage, $this->getMock('\\OAuth\\OAuth1\\Signature\\SignatureInterface'), $this->getMock('\\OAuth\\Common\\Http\\Uri\\UriInterface'));
     $this->assertSame('response!', $service->request('/my/awesome/path'));
 }
Example #2
0
 /**
  * @covers OAuth\OAuth1\Service\Yahoo::__construct
  * @covers OAuth\OAuth1\Service\Yahoo::getAccessTokenEndpoint
  */
 public function testGetAccessTokenEndpoint()
 {
     $service = new Yahoo($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://api.login.yahoo.com/oauth/v2/get_token', (string) $service->getAccessTokenEndpoint());
 }