/** * @expectedException Apache_Solr_HttpTransportException */ public function testThreads404() { $expectedUrl = "http://localhost:8180/solr/admin/threads?wt=json"; $expectedTimeout = false; // set a mock transport $mockTransport = $this->getMockHttpTransportInterface(); // setup expected call and response $mockTransport->expects($this->once())->method('performGetRequest')->with($this->equalTo($expectedUrl), $this->equalTo($expectedTimeout))->will($this->returnValue(Apache_Solr_HttpTransport_ResponseTest::get404Response())); // call threads $fixture = new Apache_Solr_service(); $fixture->setHttpTransport($mockTransport); $fixture->threads(); }