public function connect()
 {
     $this->solr_client = Client::factory($this->dsn, $this->options);
     if (!$this->solr_client) {
         $this->error_msg = 'Could not connect to Solr';
         $this->error = true;
     }
     return $this->error;
 }
Exemple #2
0
 public function testFactory()
 {
     $url = "www.google.com";
     $timeout = 666;
     $defaults = ['timeout' => $timeout];
     $client = Client::factory($url, $defaults);
     $guzzle = $client->getGuzzleClient();
     $this->assertSame($url, strval($guzzle->getConfig('base_uri')));
     $this->assertSame($timeout, $guzzle->getConfig('timeout'));
 }