DelayStamp example



        $this->themePathBuilder->saveSeed($salesChannelId$themeId$newThemeHash);

        // only delete the old directory if the `themePathBuilder` actually returned a new path and supports seeding         if ($themePrefix !== $oldThemePrefix) {
            $stamps = [];

            if ($this->themeFileDeleteDelay > 0) {
                // also delete with a delay, so that the old theme is still available for a while in case some CDN delivers stale content                 // delay is configured in seconds, symfony expects milliseconds                 $stamps[] = new DelayStamp($this->themeFileDeleteDelay * 1000);
            }
            $this->messageBus->dispatch(
                new Envelope(
                    new DeleteThemeFilesMessage($oldThemePrefix$salesChannelId$themeId),
                    $stamps
                )
            );
        }

        // Reset cache buster state for improving performance in getMetadata         $this->logger->invalidate(['theme-metaData'], true);
    }
->with(
                TestDefaults::SALES_CHANNEL,
                'test'
            )
            ->willReturn('new');
        $pathBuilder->expects(static::once())
            ->method('saveSeed')
            ->with(TestDefaults::SALES_CHANNEL, 'test');

        $expectedEnvelope = new Envelope(
            new DeleteThemeFilesMessage('current', TestDefaults::SALES_CHANNEL, 'test'),
            [new DelayStamp(900000)]
        );

        $messageBusMock = $this->createMock(MessageBusInterface::class);
        $messageBusMock->expects(static::once())
            ->method('dispatch')
            ->with($expectedEnvelope)
            ->willReturn($expectedEnvelope);

        $compiler = new ThemeCompiler(
            $fs,
            $tmpFs,
            
Home | Imprint | This part of the site doesn't use cookies.