function DiscoveryTraitTest::testDoGetDefinitionException
Same name in other branches
- 9 core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryTraitTest::testDoGetDefinitionException()
- 8.9.x core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryTraitTest::testDoGetDefinitionException()
- 11.x core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryTraitTest::testDoGetDefinitionException()
@covers ::doGetDefinition @dataProvider providerDoGetDefinitionException @uses \Drupal\Component\Plugin\Exception\PluginNotFoundException
File
-
core/
tests/ Drupal/ Tests/ Component/ Plugin/ Discovery/ DiscoveryTraitTest.php, line 66
Class
- DiscoveryTraitTest
- @group Plugin @coversDefaultClass \Drupal\Component\Plugin\Discovery\DiscoveryTrait
Namespace
Drupal\Tests\Component\Plugin\DiscoveryCode
public function testDoGetDefinitionException($expected, $definitions, $plugin_id) : void {
$trait = new DiscoveryTraitMockableClass();
// Un-protect the method using reflection.
$method_ref = new \ReflectionMethod($trait, 'doGetDefinition');
// Call doGetDefinition, with $exception_on_invalid always TRUE.
$this->expectException(PluginNotFoundException::class);
$method_ref->invoke($trait, $definitions, $plugin_id, TRUE);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.