ThemeInheritanceBuilder example

private MockObject&StorefrontPluginRegistry $themeRegistryMock;

    private ThemeInheritanceBuilder $builder;

    private StorefrontPluginConfigurationFactory $configFactory;

    protected function setUp(): void
    {
        $this->themeRegistryMock = $this->createMock(StorefrontPluginRegistry::class);

        $this->builder = new ThemeInheritanceBuilder($this->themeRegistryMock);

        $this->configFactory = $this->getContainer()->get(StorefrontPluginConfigurationFactory::class);
    }

    public function testInheritanceWithConfig(): void
    {
        $configs = new StorefrontPluginConfigurationCollection([
            $this->configFactory->createFromBundle(new Storefront()),
            $this->configFactory->createFromBundle(new InheritanceWithConfig()),
        ]);

        
/** * @internal * * @covers \Shopware\Storefront\Theme\Twig\ThemeInheritanceBuilder */
class ThemeInheritanceBuilderTest extends TestCase
{
    private ThemeInheritanceBuilder $builder;

    protected function setUp(): void
    {
        $this->builder = new ThemeInheritanceBuilder(new TestStorefrontPluginRegistry(
            new StorefrontPluginConfigurationCollection([
                new StorefrontPluginConfiguration('Storefront'),
            ])
        ));
    }

    public function testBuildPreservesThePluginOrder(): void
    {
        $result = $this->builder->build([
            'ExtensionPlugin' => [],
            'BasePlugin' => [],
            
Home | Imprint | This part of the site doesn't use cookies.