Ejemplo n.º 1
0
 public static function get400Response($createDocuments = true, $collapseSingleValueArrays = true)
 {
     return new Apache_Solr_Response(Apache_Solr_HttpTransport_ResponseTest::get400Response(), $createDocuments, $collapseSingleValueArrays);
 }
Ejemplo n.º 2
0
 /**
  * @expectedException Apache_Solr_HttpTransportException
  */
 public function testAdd400()
 {
     $postData = "does not have to be valid";
     $expectedUrl = "http://localhost:8180/solr/update?wt=json";
     $expectedTimeout = false;
     $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::get400Response()));
     // call add
     $fixture = new Apache_Solr_service();
     $fixture->setHttpTransport($mockTransport);
     $fixture->add($postData);
 }