// Create a configurable plugin that would add a dependency.
$instance_id = $this->randomMachineName(); $instance = newTestConfigurablePlugin([], $instance_id, $definition);
publicfunctiontestCalculateDependencies(){ $this->themeHandler->themeExists('stark')->willReturn(TRUE); $values = ['theme' => 'stark']; // Mock the entity under test so that we can mock getPluginCollections().
$entity = $this->getMockBuilder('\Drupal\block\Entity\Block') ->setConstructorArgs([$values, $this->entityTypeId]) ->onlyMethods(['getPluginCollections']) ->getMock(); // Create a configurable plugin that would add a dependency.
$instance_id = $this->randomMachineName(); $this->moduleHandler->moduleExists('test')->willReturn(TRUE); $instance = newTestConfigurablePlugin([], $instance_id, ['provider' => 'test']);