예제 #1
0
 public function testDelete()
 {
     $postData = "does not have to be valid";
     $expectedUrl = "http://localhost:8180/solr/update?wt=json";
     $expectedTimeout = 3600;
     // default for delete
     $expectedPostData = $postData;
     $expectedContentType = "text/xml; charset=UTF-8";
     // default for _sendRawPost
     // set a mock transport
     $mockTransport = $this->getMockHttpTransportInterface();
     // setup expected call and response
     $mockTransport->expects($this->once())->method('performPostRequest')->with($this->equalTo($expectedUrl), $this->equalTo($postData), $this->equalTo($expectedContentType), $this->equalTo($expectedTimeout))->will($this->returnValue(Apache_Solr_HttpTransport_ResponseTest::get200Response()));
     // call add
     $fixture = new Apache_Solr_service();
     $fixture->setHttpTransport($mockTransport);
     $fixture->delete($postData);
 }