/** * Updates all facets of a given facet source with the results. * * @param string $facetsource_id * The facet source ID of the currently processed facet. */ public function updateResults($facetsource_id) { $facets = $this->getFacetsByFacetSourceId($facetsource_id); if ($facets) { /** @var \drupal\facets\FacetSource\FacetSourcePluginInterface $facet_source_plugin */ $facet_source_plugin = $this->facetSourcePluginManager->createInstance($facetsource_id); $facet_source_plugin->fillFacetsWithResults($facets); } }
/** * Tests plugin manager's getDefinitions method. */ public function testGetDefinitions() { $definitions = array('foo' => array('label' => $this->randomMachineName())); $this->discovery->expects($this->once())->method('getDefinitions')->willReturn($definitions); $this->assertSame($definitions, $this->sut->getDefinitions()); }