Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
TestingArrayAdapter example
return
new
ProxyAdapter
(
new
FilesystemAdapter
(
)
, '',
$defaultLifetime
)
;
}
return
new
ProxyAdapter
(
new
ArrayAdapter
(
)
, '',
$defaultLifetime
)
;
}
public
function
testProxyfiedItem
(
)
{
$this
->
expectException
(
\Exception::
class
)
;
$this
->
expectExceptionMessage
(
'OK bar'
)
;
$item
=
new
CacheItem
(
)
;
$pool
=
new
ProxyAdapter
(
new
TestingArrayAdapter
(
$item
)
)
;
$proxyItem
=
$pool
->
getItem
(
'foo'
)
;
$this
->
assertNotSame
(
$item
,
$proxyItem
)
;
$pool
->
save
(
$proxyItem
->
set
(
'bar'
)
)
;
}
}
class
TestingArrayAdapter
extends
ArrayAdapter
{
private
CacheItemInterface
$item
;