Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
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
)
;