Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CachedSitemapRoute example
new
PaymentMethodEntity
(
)
,
new
ShippingMethodEntity
(
)
,
new
ShippingLocation
(
new
CountryEntity
(
)
, null, null
)
,
new
CustomerEntity
(
)
,
new
CashRoundingConfig
(
1, 1.1, true
)
,
new
CashRoundingConfig
(
1, 1.1, true
)
)
;
$this
->response =
new
SitemapRouteResponse
(
new
SitemapCollection
(
)
)
;
$this
->cachedRoute =
new
CachedSitemapRoute
(
$this
->decorated,
$this
->cache,
$this
->
createMock
(
EntityCacheKeyGenerator::
class
)
,
$this
->
createMock
(
AbstractCacheTracer::
class
)
,
$this
->eventDispatcher,
[
]
,
$this
->
createMock
(
SystemConfigService::
class
)
)
;
}
public
function
testLoadWithDisabledCacheWillCallDecoratedRoute
(
)
: void
{
$counter
=
new
SitemapRouteCounter
(
$this
->
getContainer
(
)
->
get
(
'Shopware\Core\Content\Sitemap\SalesChannel\CachedSitemapRoute.inner'
)
)
;
$config
=
$this
->
createMock
(
SystemConfigService::
class
)
;
$config
->
expects
(
static
::
any
(
)
)
->
method
(
'getInt'
)
->
with
(
'core.sitemap.sitemapRefreshStrategy'
)
->
willReturn
(
$strategy
)
;
$route
=
new
CachedSitemapRoute
(
$counter
,
$this
->
getContainer
(
)
->
get
(
'cache.object'
)
,
$this
->
getContainer
(
)
->
get
(
EntityCacheKeyGenerator::
class
)
,
$this
->
getContainer
(
)
->
get
(
CacheTracer::
class
)
,
$this
->
getContainer
(
)
->
get
(
'event_dispatcher'
)
,
[
]
,
$config
)
;
$before
(
$this
->context,
$this
->
getContainer
(
)
)
;