CacheWarmer example

private ProductRouteWarmer&MockObject $productRouteWarmerMock;

    protected function setUp(): void
    {
        $this->salesChannelDomainRepositoryMock = $this->createMock(EntityRepository::class);
        $this->busMock = $this->createMock(MessageBusInterface::class);
        $this->registryMock = $this->createMock(CacheRouteWarmerRegistry::class);
        $this->cacheIdLoader = $this->createMock(CacheIdLoader::class);
        $this->productRouteWarmerMock = $this->createMock(ProductRouteWarmer::class);

        $this->cacheWarmer = new CacheWarmer(
            $this->salesChannelDomainRepositoryMock,
            $this->busMock,
            $this->registryMock,
            $this->cacheIdLoader
        );
    }

    public function testWarmUpNoId(): void
    {
        $salesChannelDomain = new SalesChannelDomainEntity();
        $salesChannelDomain->setId(Uuid::randomHex());
        
Home | Imprint | This part of the site doesn't use cookies.