function PluginManagerBaseTest::getMockFactoryInterface
Generates a mocked FactoryInterface object with known properties.
2 calls to PluginManagerBaseTest::getMockFactoryInterface()
- PluginManagerBaseTest::testCreateInstance in core/
tests/ Drupal/ Tests/ Component/ Plugin/ PluginManagerBaseTest.php  - Tests createInstance() with no fallback methods.
 - PluginManagerBaseTest::testCreateInstanceFallback in core/
tests/ Drupal/ Tests/ Component/ Plugin/ PluginManagerBaseTest.php  - Tests createInstance() with a fallback method.
 
File
- 
              core/
tests/ Drupal/ Tests/ Component/ Plugin/ PluginManagerBaseTest.php, line 40  
Class
- PluginManagerBaseTest
 - @coversDefaultClass \Drupal\Component\Plugin\PluginManagerBase[[api-linebreak]] @group Plugin
 
Namespace
Drupal\Tests\Component\PluginCode
public function getMockFactoryInterface($expects_count) {
  $mock_factory = $this->createMock('Drupal\\Component\\Plugin\\Factory\\FactoryInterface');
  $mock_factory->expects($this->exactly($expects_count))
    ->method('createInstance')
    ->willReturnCallback([
    $this,
    'createInstanceCallback',
  ]);
  return $mock_factory;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.