Пример #1
0
 public static function get0Response($createDocuments = true, $collapseSingleValueArrays = true)
 {
     return new Apache_Solr_Response(Apache_Solr_HttpTransport_ResponseTest::get0Response(), $createDocuments, $collapseSingleValueArrays);
 }
Пример #2
0
 public function testPingReturnsFalse()
 {
     $expectedUrl = "http://localhost:8180/solr/admin/ping";
     $expectedTimeout = 2;
     // set a mock transport
     $mockTransport = $this->getMockHttpTransportInterface();
     // setup expected call and response
     $mockTransport->expects($this->once())->method('performHeadRequest')->with($this->equalTo($expectedUrl), $this->equalTo($expectedTimeout))->will($this->returnValue(Apache_Solr_HttpTransport_ResponseTest::get0Response()));
     // call ping
     $fixture = new Apache_Solr_service();
     $fixture->setHttpTransport($mockTransport);
     $this->assertFalse($fixture->ping());
 }