use Symfony\Component\Serializer\Tests\Fixtures\EnvelopeObject;
use Symfony\Component\Serializer\Tests\Fixtures\NormalizableTraversableDummy;
use Symfony\Component\Serializer\Tests\Fixtures\ScalarDummy;
class XmlEncoderTest extends TestCase
{ private XmlEncoder
$encoder;
private string
$exampleDateTimeString = '2017-02-19T15:16:08+0300';
protected function setUp(): void
{ $this->encoder =
new XmlEncoder();
$serializer =
new Serializer([new CustomNormalizer()],
['xml' =>
new XmlEncoder()]);
$this->encoder->
setSerializer($serializer);
} public function testEncodeScalar() { $obj =
new ScalarDummy();
$obj->xmlFoo = 'foo';
$expected = '<?xml version="1.0"?>'."\n".
'<response>foo</response>'."\n";