Ejemplo n.º 1
0
 public function setUp()
 {
     $this->_mockCredentialsStorage = ehough_mockery_Mockery::mock('ehough_coauthor_spi_v1_TemporaryCredentialsStorageInterface');
     $this->_mockSigner = ehough_mockery_Mockery::mock('ehough_coauthor_spi_v1_SignerInterface');
     $this->_mockClientCredentials = new ehough_coauthor_api_v1_Credentials('id', 'secret');
     $this->_mockTokenCredentials = new ehough_coauthor_api_v1_Credentials('id2', 'secret2');
     $this->_mockRedirectUrl = new ehough_curly_Url('http://fooz.baz/z/xy/s.php');
     $this->_mockServer = ehough_mockery_Mockery::mock('ehough_coauthor_api_v1_AbstractServer');
     $this->_mockCredentialsFetcher = ehough_mockery_Mockery::mock('ehough_coauthor_spi_v1_RemoteCredentialsFetcherInterface');
     $this->_mockServer->shouldReceive('getTemporaryCredentialsEndpoint')->andReturn(new ehough_curly_Url('http://temp.com/a/f/2.php?x=z'));
     $this->_mockServer->shouldReceive('getAuthorizationEndpoint')->andReturn(new ehough_curly_Url('http://auth.org/w2/d/z.php?a=b'));
     $this->_mockServer->shouldReceive('getTokensEndpoint')->andReturn(new ehough_curly_Url('http://tokens.net/w2/d/z.php?a=b'));
     $this->_mockServer->shouldReceive('getFriendlyName')->andReturn('coolserver');
     $this->_sut = new ehough_coauthor_impl_v1_DefaultV1Client($this->_mockCredentialsStorage, $this->_mockCredentialsFetcher, $this->_mockSigner);
     $this->_sut->___setTestMode(true);
 }
 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);
 }
Ejemplo n.º 3
0
 public function testMockeryCloseForIllegalIssetFileInclude()
 {
     $m = ehough_mockery_Mockery::mock('StdClass')->shouldReceive('get')->andReturn(false)->getMock();
     $m->get();
     ehough_mockery_Mockery::close();
 }