diff --git a/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php index 844c8152d3..f76fc672fe 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php @@ -16,10 +16,25 @@ */ class PluginDependencyTraitTest extends UnitTestCase { + /** + * @covers ::getPluginDependencies + * + * @dataProvider providerTestPluginDependencies + */ + public function testGetPluginDependencies(ProphecyInterface $plugin, $definition, array $expected) { + $test_class = new TestPluginDependency(); + + $plugin->getPluginDefinition()->willReturn($definition); + + $actual = $test_class->getPluginDependencies($plugin->reveal()); + $this->assertEquals($expected, $actual); + $this->assertEmpty($test_class->getDependencies()); + } + /** * @covers ::calculatePluginDependencies * - * @dataProvider providerTestCalculatePluginDependencies + * @dataProvider providerTestPluginDependencies * * @param \Prophecy\Prophecy\ProphecyInterface $plugin * A prophecy of a plugin instance. @@ -38,9 +53,9 @@ public function testCalculatePluginDependencies(ProphecyInterface $plugin, $defi } /** - * Provides test data for ::testCalculatePluginDependencies(). + * Provides test data for plugin dependencies. */ - public function providerTestCalculatePluginDependencies() { + public function providerTestPluginDependencies() { $data = []; $plugin = $this->prophesize(PluginInspectionInterface::class); @@ -111,6 +126,7 @@ class TestPluginDependency { use PluginDependencyTrait { calculatePluginDependencies as public; + getPluginDependencies as public; } /**