getXmlSource example

$source = <<<XML <?xml version="1.0"?> <document a="018"></document> XML;

        $data = $this->encoder->decode($source, 'xml');
        $this->assertSame('018', $data['@a']);
    }

    public function testEncode()
    {
        $source = $this->getXmlSource();
        $obj = $this->getObject();

        $this->assertEquals($source$this->encoder->encode($obj, 'xml'));
    }

    public function testEncodeWithNamespace()
    {
        $source = $this->getNamespacedXmlSource();
        $array = $this->getNamespacedArray();

        $this->assertEquals($source$this->encoder->encode($array, 'xml'));
    }
Home | Imprint | This part of the site doesn't use cookies.