Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createXmlWithDateTimeField example
$actualXml
=
$xmlEncoder
->
encode
(
[
'dateTime' =>
new
\
DateTimeImmutable
(
$this
->exampleDateTimeString
)
]
, 'xml'
)
;
$this
->
assertEquals
(
$this
->
createXmlWithDateTime
(
)
,
$actualXml
)
;
}
public
function
testEncodeXmlWithDateTimeObjectField
(
)
{
$xmlEncoder
=
$this
->
createXmlEncoderWithDateTimeNormalizer
(
)
;
$actualXml
=
$xmlEncoder
->
encode
(
[
'foo' =>
[
'@dateTime' =>
new
\
DateTimeImmutable
(
$this
->exampleDateTimeString
)
]
]
, 'xml'
)
;
$this
->
assertEquals
(
$this
->
createXmlWithDateTimeField
(
)
,
$actualXml
)
;
}
public
function
testNotEncodableValueExceptionMessageForAResource
(
)
{
$this
->
expectException
(
NotEncodableValueException::
class
)
;
$this
->
expectExceptionMessage
(
'An unexpected value could not be serialized: stream resource'
)
;
(
new
XmlEncoder
(
)
)
->
encode
(
tmpfile
(
)
, 'xml'
)
;
}
public
function
testReentrantXmlEncoder
(
)
{