Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setClientTtl example
$response
->headers->
set
(
'Age', 0
)
;
$this
->
assertSame
(
0,
$response
->
getTtl
(
)
, '->getTtl() correctly handles zero'
)
;
$response
=
new
Response
(
)
;
$response
->headers->
set
(
'Cache-Control', 'max-age=60'
)
;
$this
->
assertEquals
(
60,
$response
->
getTtl
(
)
, '->getTtl() uses Cache-Control max-age when present'
)
;
}
public
function
testSetClientTtl
(
)
{
$response
=
new
Response
(
)
;
$response
->
setClientTtl
(
10
)
;
$this
->
assertEquals
(
$response
->
getMaxAge
(
)
,
$response
->
getAge
(
)
+ 10
)
;
}
public
function
testGetSetProtocolVersion
(
)
{
$response
=
new
Response
(
)
;
$this
->
assertEquals
(
'1.0',
$response
->
getProtocolVersion
(
)
)
;
$response
->
setProtocolVersion
(
'1.1'
)
;