Example #1
0
 /**
  * Test simple getters.
  *
  * @return void
  */
 public function testGetters()
 {
     $url = 'http://example.tld/';
     $map = new HandlerMap(['select' => ['fallback' => true]]);
     $key = 'foo';
     $conn = new Connector($url, $map, $key);
     $this->assertEquals($url, $conn->getUrl());
     $this->assertEquals($map, $conn->getMap());
     $this->assertEquals($key, $conn->getUniqueKey());
 }
Example #2
0
 /**
  * Extract the Solr core from a connector's URL.
  *
  * @param Connector $connector Solr connector
  *
  * @return string
  */
 protected function getCore(Connector $connector)
 {
     $url = rtrim($connector->getUrl(), '/');
     $parts = explode('/', $url);
     return array_pop($parts);
 }