function SearchPluginCollectionTest::testGet
Tests the get() method.
File
- 
              core/modules/ search/ tests/ src/ Unit/ SearchPluginCollectionTest.php, line 57 
Class
Namespace
Drupal\Tests\search\UnitCode
public function testGet() : void {
  $plugin = $this->createMock('Drupal\\search\\Plugin\\SearchInterface');
  $this->pluginManager
    ->expects($this->once())
    ->method('createInstance')
    ->willReturn($plugin);
  $this->assertSame($plugin, $this->searchPluginCollection
    ->get('banana'));
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
