Doctrine\Tests\OXM\Marshaller\MarshallerTest::itShouldHandleMappedSuperclassesCorrectly PHP Method

itShouldHandleMappedSuperclassesCorrectly() public method

    public function itShouldHandleMappedSuperclassesCorrectly()
    {
        $simple = new SimpleChild();
        $xml = $this->marshaller->marshalToString($simple);
        $this->assertTrue(strlen($xml) > 0);
        $this->assertXmlStringEqualsXmlString('<?xml version="1.0" encoding="UTF-8"?><simple-child><other>yes</other></simple-child>', $xml);
        $simple = new SimpleChildExtendsWithChildField();
        $simple->id = 1;
        $simple->other = "no";
        $xml = $this->marshaller->marshalToString($simple);
        $this->assertTrue(strlen($xml) > 0);
        $this->assertXmlStringEqualsXmlString('<?xml version="1.0" encoding="UTF-8"?>
            <simple-child-extends-with-child-field id="1">
                <other>no</other>
            </simple-child-extends-with-child-field>', $xml);
        $simple = new SimpleChildExtendsWithParentField();
        $xml = $this->marshaller->marshalToString($simple);
        $this->assertTrue(strlen($xml) > 0);
        $this->assertXmlStringEqualsXmlString('<?xml version="1.0" encoding="UTF-8"?><simple-child-extends-with-parent-field id="2"/>', $xml);
    }