function PluginFormFactoryTest::testCreateInstanceDefinitionException
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Plugin/PluginFormFactoryTest.php \Drupal\Tests\Core\Plugin\PluginFormFactoryTest::testCreateInstanceDefinitionException()
- 10 core/tests/Drupal/Tests/Core/Plugin/PluginFormFactoryTest.php \Drupal\Tests\Core\Plugin\PluginFormFactoryTest::testCreateInstanceDefinitionException()
- 11.x core/tests/Drupal/Tests/Core/Plugin/PluginFormFactoryTest.php \Drupal\Tests\Core\Plugin\PluginFormFactoryTest::testCreateInstanceDefinitionException()
@covers ::createInstance
File
-
core/
tests/ Drupal/ Tests/ Core/ Plugin/ PluginFormFactoryTest.php, line 127
Class
- PluginFormFactoryTest
- @coversDefaultClass \Drupal\Core\Plugin\PluginFormFactory @group Plugin
Namespace
Drupal\Tests\Core\PluginCode
public function testCreateInstanceDefinitionException() {
$this->expectException(InvalidPluginDefinitionException::class);
$this->expectExceptionMessage('The "the_plugin_id" plugin did not specify a "anything" form class');
$plugin = $this->prophesize(PluginWithFormsInterface::class);
$plugin->getPluginId()
->willReturn('the_plugin_id');
$plugin->hasFormClass('anything')
->willReturn(FALSE);
$form_object = $this->manager
->createInstance($plugin->reveal(), 'anything');
$this->assertSame(NULL, $form_object);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.