You are here

public function SearchPluginCollectionTest::testGet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php \Drupal\Tests\search\Unit\SearchPluginCollectionTest::testGet()

Tests the get() method.

File

core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php, line 51
Contains \Drupal\Tests\search\Unit\SearchPluginCollectionTest.

Class

SearchPluginCollectionTest
@coversDefaultClass \Drupal\search\Plugin\SearchPluginCollection @group search

Namespace

Drupal\Tests\search\Unit

Code

public function testGet() {
  $plugin = $this
    ->getMock('Drupal\\search\\Plugin\\SearchInterface');
  $this->pluginManager
    ->expects($this
    ->once())
    ->method('createInstance')
    ->will($this
    ->returnValue($plugin));
  $this
    ->assertSame($plugin, $this->searchPluginCollection
    ->get('banana'));
}