コード例 #1
0
 public function setUp()
 {
     $this->_mockSigner = ehough_mockery_Mockery::mock('ehough_coauthor_spi_v1_SignerInterface');
     $this->_mockClientCredentials = new ehough_coauthor_api_v1_Credentials('id', 'secret');
     $this->_mockTemporaryCredentials = new ehough_coauthor_api_v1_Credentials('id2', 'secret2');
     $this->_mockServer = ehough_mockery_Mockery::mock('ehough_coauthor_api_v1_AbstractServer');
     $this->_mockHttpClient = ehough_mockery_Mockery::mock('ehough_shortstop_api_HttpClientInterface');
     $this->_mockServer->shouldReceive('getTemporaryCredentialsEndpoint')->andReturn(new ehough_curly_Url('http://abc.com/a/f/2.php?x=z'));
     $this->_mockServer->shouldReceive('getTokensEndpoint')->andReturn(new ehough_curly_Url('http://xez.net/w2/d/z.php?a=b'));
     $this->_mockHttpResponse = new ehough_shortstop_api_HttpResponse();
     $this->_mockHttpResponse->setStatusCode(200);
     $entity = new ehough_shortstop_api_HttpEntity();
     $entity->setContent('oauth_token=token&oauth_token_secret=secrettt');
     $this->_mockHttpResponse->setEntity($entity);
     $this->_sut = new ehough_coauthor_impl_v1_DefaultRemoteCredentialsFetcher($this->_mockHttpClient, $this->_mockSigner);
 }
コード例 #2
0
ファイル: VimeoServerTest.php プロジェクト: ehough/coauthor
 public function testAfterCredentialsOrTokenRequest()
 {
     $request = new ehough_shortstop_api_HttpRequest('POST', 'http://abc.com');
     $httpResponse = new ehough_shortstop_api_HttpResponse();
     $httpResponse->setStatusCode(200);
     $this->_sut->onAfterCredentialsOrTokenRequest($request, $httpResponse);
     $this->assertTrue(true);
 }
コード例 #3
0
 private function _assignStatusToResponse(ehough_shortstop_api_HttpResponse $response, ehough_shortstop_api_HttpRequest $request, $debugging)
 {
     $code = $this->getResponseCode();
     if ($debugging) {
         $this->getLogger()->debug(sprintf('%s returned HTTP %s', $request, $code));
     }
     $response->setStatusCode($code);
 }