コード例 #1
0
ファイル: BoxTest.php プロジェクト: kunal981/php-oauth
 /**
  * @covers OAuth\OAuth2\Service\Box::__construct
  * @covers OAuth\OAuth2\Service\Box::getAccessTokenEndpoint
  */
 public function testGetAccessTokenEndpoint()
 {
     $service = new Box($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $this->getMock('\\Buzz\\Browser'), $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface'));
     $this->assertSame('https://www.box.com/api/oauth2/token', (string) $service->getAccessTokenEndpoint());
 }
コード例 #2
0
ファイル: BoxTest.php プロジェクト: Flesh192/magento
 /**
  * @covers OAuth\OAuth2\Service\Box::__construct
  * @covers OAuth\OAuth2\Service\Box::parseAccessTokenResponse
  */
 public function testParseAccessTokenResponseValidWithRefreshToken()
 {
     $client = $this->getMock('\\OAuth\\Common\\Http\\Client\\ClientInterface');
     $client->expects($this->once())->method('retrieveResponse')->will($this->returnValue('{"access_token":"foo","expires_in":"bar","refresh_token":"baz"}'));
     $service = new Box($this->getMock('\\OAuth\\Common\\Consumer\\CredentialsInterface'), $client, $this->getMock('\\OAuth\\Common\\Storage\\TokenStorageInterface'));
     $this->assertInstanceOf('\\OAuth\\OAuth2\\Token\\StdOAuth2Token', $service->requestAccessToken('foo'));
 }