Esempio n. 1
0
 /**
  * Sets up the mock objects.
  */
 function setUp()
 {
     $this->httpClientMock = $this->getMock('SolrHttpClient', array('sendRequest'));
     $this->solr = SolrConnection::__set_state(array('httpClient' => $this->httpClientMock));
     $field = $this->getMock('SolrField');
     $field->expects($this->any())->method('getName')->will($this->returnValue('foo'));
     $field->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
     $field->expects($this->any())->method('getBoost')->will($this->returnValue(null));
     $this->document = $this->getMock('SolrDocument');
     $this->document->expects($this->any())->method('getFields')->will($this->returnValue(array($field)));
     $this->document->expects($this->any())->method('getBoost')->will($this->returnValue(null));
 }
Esempio n. 2
0
 /**
  * Sets up the mock objects.
  */
 function setUp()
 {
     $this->httpClientMock = $this->getMock('SolrHttpClient', array('sendRequest'));
     $this->solr = SolrConnection::__set_state(array('httpClient' => $this->httpClientMock));
 }