X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Ftests%2FDrupal%2FTests%2FCore%2FPlugin%2FPluginDependencyTraitTest.php;fp=web%2Fcore%2Ftests%2FDrupal%2FTests%2FCore%2FPlugin%2FPluginDependencyTraitTest.php;h=f76fc672fe53649d0e12e40a3ad862e89d8b9958;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=844c8152d366d0c1183f7f72d29950c5c70ddab4;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php b/web/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php index 844c8152d..f76fc672f 100644 --- a/web/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php +++ b/web/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php @@ -16,10 +16,25 @@ use Prophecy\Prophecy\ProphecyInterface; */ 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 @@ class PluginDependencyTraitTest extends UnitTestCase { } /** - * 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; } /**