示例#1
0
 /**
  * Test "get holdings" HTTP failure
  *
  * @return void
  *
  * @expectedException VuFindSearch\Backend\Exception\RequestErrorException
  */
 public function testGetHoldingsHttpFailure()
 {
     $client = $this->getMock('Zend\\Http\\Client');
     $connector = new Connector('key', $client);
     $client->expects($this->once())->method('setMethod')->with($this->equalTo('POST'))->will($this->returnValue($client));
     $response = $this->getMock('Zend\\Http\\Response');
     $response->expects($this->any())->method('isSuccess')->will($this->returnValue(false));
     $client->expects($this->once())->method('send')->will($this->returnValue($response));
     $connector->getHoldings('baz');
 }
示例#2
0
 /**
  * Get holdings information from WorldCat (false if none available).
  *
  * @return \SimpleXMLElement|bool
  */
 public function getHoldings()
 {
     $id = $this->getOCLCNum();
     return empty($id) ? false : $this->wc->getHoldings($id);
 }