DatabaseAvailableThemeProvider example

/** * @internal * * @covers \Shopware\Storefront\Theme\ConfigLoader\DatabaseAvailableThemeProvider */
#[Package('storefront')] class DatabaseAvailableThemeProviderTest extends TestCase
{
    public function testThemeProviderThrowsOnGetDecorated(): void
    {
        $themeProvider = new DatabaseAvailableThemeProvider(new StaticEntityRepository([]));

        static::expectException(DecorationPatternException::class);
        $themeProvider->getDecorated();
    }

    public function testLoadThrowsExceptionInNextMajorWhenCalledWithOnlyOneParameter(): void
    {
        $themeProvider = new DatabaseAvailableThemeProvider(new StaticEntityRepository([new SalesChannelCollection()]));

        static::expectException(\RuntimeException::class);
        $themeProvider->load(Context::createDefaultContext());
    }
Home | Imprint | This part of the site doesn't use cookies.