protected $pluginInstances;
/**
* {@inheritdoc}
*/
protected function setUp(): void
{ parent::
setUp();
$this->pluginManager =
$this->
createMock('Drupal\Component\Plugin\PluginManagerInterface'
);
$this->searchPluginCollection =
new SearchPluginCollection($this->pluginManager, 'banana',
['id' => 'banana', 'color' => 'yellow'
], 'fruit_stand'
);
} /**
* Tests the get() method.
*/
public function testGet() { $plugin =
$this->
createMock('Drupal\search\Plugin\SearchInterface'
);
$this->pluginManager->
expects($this->
once()) ->
method('createInstance'
) ->
willReturn($plugin);
$this->
assertSame($plugin,
$this->searchPluginCollection->
get('banana'
));
}