*/
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.
}
/**
- * Provides test data for ::testCalculatePluginDependencies().
+ * Provides test data for plugin dependencies.
*/
- public function providerTestCalculatePluginDependencies() {
+ public function providerTestPluginDependencies() {
$data = [];
$plugin = $this->prophesize(PluginInspectionInterface::class);
use PluginDependencyTrait {
calculatePluginDependencies as public;
+ getPluginDependencies as public;
}
/**