Goetas\Xsd\XsdToPhp\Tests\JmsSerializer\OTA\PHPConversionTest::testNestedMulteplicity PHP Method

testNestedMulteplicity() public method

    public function testNestedMulteplicity()
    {
        $xml = '
            <xs:schema targetNamespace="http://www.example.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">
                <xs:complexType name="single">
                    <xs:all>
                        <xs:element name="id" type="ary" minOccurs="0"/>
                    </xs:all>
                </xs:complexType>
                <xs:complexType name="ary">
                    <xs:all>
                        <xs:element name="idA" type="ary2" maxOccurs="2"/>
                    </xs:all>
                </xs:complexType>
                <xs:complexType name="ary2">
                    <xs:all>
                        <xs:element name="idB" type="xs:long" maxOccurs="2"/>
                    </xs:all>
                </xs:complexType>
            </xs:schema>';
        $items = $this->getClasses($xml);
        $this->assertCount(2, $items);
        $single = $items['Example\\SingleType'];
        $this->assertTrue($single->hasMethod('issetId'));
        $this->assertTrue($single->hasMethod('unsetId'));
        $this->assertTrue($single->hasMethod('getId'));
        $this->assertTrue($single->hasMethod('setId'));
        $ary = $items['Example\\Ary2Type'];
        $this->assertTrue($ary->hasMethod('issetIdB'));
        $this->assertTrue($ary->hasMethod('unsetIdB'));
        $this->assertTrue($ary->hasMethod('getIdB'));
        $this->assertTrue($ary->hasMethod('setIdB'));
    }