예제 #1
0
 public function testRemoveCollection()
 {
     $this->distributedSearch->addCollection('collection1', 'localhost:8983/solr/collection1');
     $this->distributedSearch->removeCollection('collection1');
     $collections = $this->distributedSearch->getCollections();
     $this->assertFalse(isset($collections['collection1']));
 }
 public function testBuildComponentWithCollections()
 {
     $builder = new RequestBuilder();
     $request = new Request();
     $component = new Component();
     $component->addCollection('collection1', 'localhost:8983/solr/collection1');
     $component->addCollections(array('collection2' => 'localhost:8983/solr/collection2', 'collection3' => 'localhost:8983/solr/collection3'));
     $request = $builder->buildComponent($component, $request);
     $this->assertEquals(array('collection' => 'localhost:8983/solr/collection1,localhost:8983/solr/collection2,localhost:8983/solr/collection3'), $request->getParams());
 }