コード例 #1
0
 /**
  * @expectedException \Facebook\Exceptions\FacebookSDKException
  */
 public function testThrowsExceptionOnClientError()
 {
     $this->curlMock->shouldReceive('init')->once()->andReturn(null);
     $this->curlMock->shouldReceive('setoptArray')->once()->andReturn(null);
     $this->curlMock->shouldReceive('exec')->once()->andReturn(false);
     $this->curlMock->shouldReceive('errno')->once()->andReturn(123);
     $this->curlMock->shouldReceive('error')->once()->andReturn('Foo error');
     $this->curlClient->send('http://foo.com/', 'GET', '', [], 60);
 }
コード例 #2
0
 /**
  * @expectedException \Facebook\Exceptions\FacebookSDKException
  */
 public function testThrowsExceptionOnClientError()
 {
     $this->curlMock->shouldReceive('init')->once()->andReturn(null);
     $this->curlMock->shouldReceive('setopt_array')->once()->andReturn(null);
     $this->curlMock->shouldReceive('exec')->once()->andReturn(false);
     $this->curlMock->shouldReceive('errno')->once()->andReturn(123);
     $this->curlMock->shouldReceive('error')->once()->andReturn('Foo error');
     $this->curlMock->shouldReceive('getinfo')->with(CURLINFO_HTTP_CODE)->once()->andReturn(null);
     $this->curlClient->send('http://foo.com/');
 }