function LazyPluginCollectionTestBase::getPluginMock
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php \Drupal\Tests\Core\Plugin\LazyPluginCollectionTestBase::getPluginMock()
- 8.9.x core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php \Drupal\Tests\Core\Plugin\LazyPluginCollectionTestBase::getPluginMock()
- 10 core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php \Drupal\Tests\Core\Plugin\LazyPluginCollectionTestBase::getPluginMock()
Returns a mocked plugin object.
Parameters
string $plugin_id: The plugin ID.
array $definition: The plugin definition.
Return value
\Drupal\Component\Plugin\PluginInspectionInterface|\PHPUnit\Framework\MockObject\MockObject
1 call to LazyPluginCollectionTestBase::getPluginMock()
- LazyPluginCollectionTestBase::setupPluginCollection in core/
tests/ Drupal/ Tests/ Core/ Plugin/ LazyPluginCollectionTestBase.php - Sets up the default plugin collection.
1 method overrides LazyPluginCollectionTestBase::getPluginMock()
- DefaultLazyPluginCollectionTest::getPluginMock in core/
tests/ Drupal/ Tests/ Core/ Plugin/ DefaultLazyPluginCollectionTest.php - Returns a mocked plugin object.
File
-
core/
tests/ Drupal/ Tests/ Core/ Plugin/ LazyPluginCollectionTestBase.php, line 109
Class
- LazyPluginCollectionTestBase
- Provides a base class for plugin collection tests.
Namespace
Drupal\Tests\Core\PluginCode
protected function getPluginMock($plugin_id, array $definition) {
// Create a mock plugin instance.
$mock = $this->createMock('Drupal\\Component\\Plugin\\PluginInspectionInterface');
$mock->expects($this->any())
->method('getPluginId')
->willReturn($plugin_id);
return $mock;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.