StaticFileConfigDumper example

public function testDumping(): void
    {
        $loader = $this->createMock(DatabaseConfigLoader::class);
        $loader->method('load')->willReturn(new StorefrontPluginConfiguration('Test'));

        $fs = $this->createMock(Filesystem::class);
        $fs->expects(static::exactly(4))->method('write');

        $themeProvider = $this->createMock(DatabaseAvailableThemeProvider::class);
        $themeProvider->method('load')->willReturn(['test' => 'test']);

        $dumper = new StaticFileConfigDumper(
            $loader,
            $themeProvider,
            $fs
        );

        $dumper->dumpConfig(Context::createDefaultContext());
        $dumper->dumpConfigFromEvent();
    }
}
Home | Imprint | This part of the site doesn't use cookies.