public function DiscoveryTraitTest::testDoGetDefinitionException in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryTraitTest::testDoGetDefinitionException()
@covers ::doGetDefinition @expectedException Drupal\Component\Plugin\Exception\PluginNotFoundException @dataProvider providerDoGetDefinitionException @uses Drupal\Component\Plugin\Exception\PluginNotFoundException
File
- core/
tests/ Drupal/ Tests/ Component/ Plugin/ Discovery/ DiscoveryTraitTest.php, line 70 - Contains \Drupal\Tests\Component\Plugin\Discovery\DiscoveryTraitTest.
Class
- DiscoveryTraitTest
- @group Plugin @coversDefaultClass Drupal\Component\Plugin\Discovery\DiscoveryTrait
Namespace
Drupal\Tests\Component\Plugin\DiscoveryCode
public function testDoGetDefinitionException($expected, $definitions, $plugin_id) {
// Mock the trait.
$trait = $this
->getMockForTrait('Drupal\\Component\\Plugin\\Discovery\\DiscoveryTrait');
// Un-protect the method using reflection.
$method_ref = new \ReflectionMethod($trait, 'doGetDefinition');
$method_ref
->setAccessible(TRUE);
// Call doGetDefinition, with $exception_on_invalid always TRUE.
$this
->assertSame($expected, $method_ref
->invoke($trait, $definitions, $plugin_id, TRUE));
}