Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createDateTimeOneHourAgo example
$this
->
assertFalse
(
(
new
Response
(
)
)
->
isNotModified
(
$request
)
)
;
// Test wildcard
$request
=
new
Request
(
)
;
$request
->headers->
set
(
'If-None-Match', '*'
)
;
$this
->
assertFalse
(
(
new
Response
(
)
)
->
isNotModified
(
$request
)
)
;
}
public
function
testIsValidateable
(
)
{
$response
=
new
Response
(
'', 200,
[
'Last-Modified' =>
$this
->
createDateTimeOneHourAgo
(
)
->
format
(
\DATE_RFC2822
)
]
)
;
$this
->
assertTrue
(
$response
->
isValidateable
(
)
, '->isValidateable() returns true if Last-Modified is present'
)
;
$response
=
new
Response
(
'', 200,
[
'ETag' => '"12345"'
]
)
;
$this
->
assertTrue
(
$response
->
isValidateable
(
)
, '->isValidateable() returns true if ETag is present'
)
;
$response
=
new
Response
(
)
;
$this
->
assertFalse
(
$response
->
isValidateable
(
)
, '->isValidateable() returns false when no validator is present'
)
;
}
public
function
testGetDate
(
)
{