/** * @covers OAuth\OAuth1\Service\Flickr::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 Flickr($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')); }
/** * @covers OAuth\OAuth1\Service\Flickr::__construct * @covers OAuth\OAuth1\Service\Flickr::getAccessTokenEndpoint */ public function testGetAccessTokenEndpoint() { $service = new Flickr($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://www.flickr.com/services/oauth/access_token', (string) $service->getAccessTokenEndpoint()); }