setThemeHandler example

public function testGetPluginDependencies(ProphecyInterface $plugin$definition, array $expected) {
    $test_class = new TestPluginDependency();

    $module_handler = $this->prophesize(ModuleHandlerInterface::class);
    $module_handler->moduleExists('test_module1')->willReturn(TRUE);
    $module_handler->moduleExists('test_theme1')->willReturn(FALSE);
    $test_class->setModuleHandler($module_handler->reveal());

    $theme_handler = $this->prophesize(ThemeHandlerInterface::class);
    $theme_handler->themeExists('test_module1')->willReturn(FALSE);
    $theme_handler->themeExists('test_theme1')->willReturn(TRUE);
    $test_class->setThemeHandler($theme_handler->reveal());

    $plugin->getPluginDefinition()->willReturn($definition);

    $actual = $test_class->getPluginDependencies($plugin->reveal());
    $this->assertEquals($expected$actual);
    $this->assertEmpty($test_class->getDependencies());
  }

  /** * @covers ::calculatePluginDependencies * * @dataProvider providerTestPluginDependencies * * @param \Prophecy\Prophecy\ProphecyInterface $plugin * A prophecy of a plugin instance. * @param mixed $definition * A plugin definition. * @param array $expected * The expected dependencies. */
Home | Imprint | This part of the site doesn't use cookies.