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()
    {
Home | Imprint | This part of the site doesn't use cookies.