Example #1
0
 /**
  * Returns endpoint instance.
  *
  * @param string $type Endpoint type.
  *
  * @return SearchEndpointInterface
  */
 private function getEndpoint($type)
 {
     if (!array_key_exists($type, $this->endpoints)) {
         $this->endpoints[$type] = SearchEndpointFactory::get($type);
     }
     return $this->endpoints[$type];
 }
 /**
  * Tests get method exception.
  *
  * @expectedException \RuntimeException
  */
 public function testGet()
 {
     SearchEndpointFactory::get('foo');
 }
 /**
  * Tests if factory can create endpoint.
  */
 public function testFactory()
 {
     SearchEndpointFactory::get(AggregationsEndpoint::NAME);
 }