public function PluginFormFactoryTest::testCreateInstanceUsingPlugin in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Plugin/PluginFormFactoryTest.php \Drupal\Tests\Core\Plugin\PluginFormFactoryTest::testCreateInstanceUsingPlugin()
@covers ::createInstance
File
- core/
tests/ Drupal/ Tests/ Core/ Plugin/ PluginFormFactoryTest.php, line 64
Class
- PluginFormFactoryTest
- @coversDefaultClass \Drupal\Core\Plugin\PluginFormFactory @group Plugin
Namespace
Drupal\Tests\Core\PluginCode
public function testCreateInstanceUsingPlugin() {
$this->classResolver
->getInstanceFromDefinition(Argument::cetera())
->shouldNotBeCalled();
$plugin = $this
->prophesize(PluginWithFormsInterface::class)
->willImplement(PluginFormInterface::class);
$plugin
->hasFormClass('configure')
->willReturn(TRUE);
$plugin
->getFormClass('configure')
->willReturn(get_class($plugin
->reveal()));
$form_object = $this->manager
->createInstance($plugin
->reveal(), 'configure');
$this
->assertSame($plugin
->reveal(), $form_object);
}