CacheStore example

$cache = $this->createMock(TagAwareAdapterInterface::class);

        $cache->expects(static::once())->method('hasItem')->willReturn(false);

        $item = new CacheItem();

        $cache->expects(static::once())->method('getItem')->willReturn($item);

        $cache->expects(static::once())->method('save')->with($item);

        $store = new CacheStore(
            $cache,
            $this->createMock(CacheStateValidator::class),
            new EventDispatcher(),
            $this->createMock(AbstractCacheTracer::class),
            new HttpCacheKeyGenerator('test', new EventDispatcher()[]),
            $this->createMock(MaintenanceModeResolver::class),
            []
        );

        $store->lock($request);

        
Home | Imprint | This part of the site doesn't use cookies.