Ejemplo n.º 1
0
 /**
  * Test merged param bag.
  *
  * @return void
  */
 public function testMergedParamBag()
 {
     $myParams = new ParamBag(['foo' => 'bar']);
     $expectedParams = ['foo' => 'bar', 'limit' => 10, 'pageNumber' => 1.0, 'query' => [['index' => null, 'lookfor' => 'baz']]];
     $conn = $this->getConnectorMock(['query']);
     $conn->expects($this->once())->method('query')->with($this->equalTo('inst-id'), $this->equalTo($expectedParams['query']), $this->equalTo($expectedParams))->will($this->returnValue(['recordCount' => 0, 'documents' => []]));
     $back = new Backend($conn);
     $back->search(new Query('baz'), 0, 10, $myParams);
 }
Ejemplo n.º 2
0
 /**
  * Create the Primo Central backend.
  *
  * @param Connector $connector Connector
  *
  * @return Backend
  */
 protected function createBackend(Connector $connector)
 {
     $backend = new Backend($connector, $this->createRecordCollectionFactory());
     $backend->setLogger($this->logger);
     $backend->setQueryBuilder($this->createQueryBuilder());
     return $backend;
 }